RSA/RC2 key exchange

From: Kipp Hawley (kh@traxonline.com)
Date: 10/29/02


From: "Kipp Hawley" <kh@traxonline.com>
Date: Mon, 28 Oct 2002 17:59:59 -0800


Hi again...

Okay, I give up - what's the answer? What is the .NET equivalent of the
CryptoAPI call CryptImportKey()?

I'm trying to exchange encrypted data between an ActiveX object and a .NET
web service. The object fetches the service's RSA public key, then uses it
to encrypt its own RC2 session key by calling
CCryptRandomKey.ExportSimpleBlob(). Finally it sends its data to the web
service along with the key blob and its IV.

On the .NET side, I init the RSA cryptoprovider then try to use it to
decrypt the session key (which begins at offset 12 in the session key blob),
but no matter what I do it always throws a "Bad Data" exception. The
documentation on the .NET encryption keys is as thin as gossamer, so there's
no help there. I've tried giving it the whole thing, breaking it up into 16
byte blocks, 4 byte blocks, always the same rc.

How does Microsoft recommend decrypting session keys sent as keyblobs? Is
there a better way to exchange keys with non-.NET platforms?

Thanks in advance for any help,
Kipp Hawley
Trax Softworks, Inc.



Relevant Pages

  • Re: Diffie Hellman to generate Symmetric key
    ... > my projects to generate a session key. ... > by AES to encrypt the messages. ... > key to get the appropriate AES key size. ... I looked into how to interoperate Perl with CryptoAPI. ...
    (sci.crypt)
  • RE: NTE_BAD_DATA
    ... use CryptExportKey to encrypt the session key with the public key ... DWORD dwBlockLen; ... goto Exit_MyDecryptFile; ...
    (microsoft.public.platformsdk.security)
  • Re: RSA Encryption without Session Keys - (I know its a bad idea)
    ... you can encrypt a password the same way you encrypt a ... session key as long as the length of the password is smaller than the length ... symmetric session key, encrypt the password with the session key, ... Does CryptoAPI support RSA + CBC without using session ...
    (microsoft.public.platformsdk.security)
  • Re: CryptImportKey
    ... Whan you "encrypt" your server-generated session key your parameter is ... AT_KEYEXCHANGE - but CAPI will use the PUBLIC key portion of that key pair ... The client and server communicating over TCP/IP. ...
    (microsoft.public.platformsdk.security)
  • Re: CryptImportKey
    ... Whan you "encrypt" your server-generated session key your parameter is ... AT_KEYEXCHANGE - but CAPI will use the PUBLIC key portion of that key pair ... The client and server communicating over TCP/IP. ...
    (microsoft.public.platformsdk.security)