RSA Encryption without Session Keys - (I know it's a bad idea)



I'm looking into replacing openssl in my application with CryptoAPI.
The problem I've run into is my application uses openssl to encrypt
passwords with a public key. This "encrypted" password is transmitted
to a server that decrypts the password with the appropriate private
key. I understand the correct thing to do would be to generate a
symmetric session key, encrypt the password with the session key,
encrypt the session key with the public key, and then transmit both
the encrypted key and message to the server. However, I can't do that,
I've been told to maintain backward compatibility, i.e., I can't touch
the server.

The samples that illustrate RSA usage all seem to follow the method of
generating a symmetric key. Is there a sample available that just
demonstrates a straight public-key encryption of a message without a
symmetric key? Am I mistaken in assuming that CryptoAPI seems oriented
towards the generation of symmetric session keys when using asymmetric
encryption? Is there a way I can use my public-key as my session key?

Any hints/help would be appreciated.

Thanks,

S
.



Relevant Pages

  • 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)
  • 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 for the key encryption. ... IF you insist the server to generate a new session key than encrypt that key with the client's SESSION key. ...
    (microsoft.public.platformsdk.security)
  • Re: gnupg /rsa question // can a public rsa key be reconstructed from a plaintext and ciphertext ?
    ... >to encrypt the session key, ... >gnupg allows Bob to anonymize his key, ... Pretty poor assumption for a public key system. ... >and also the ciphertext of the session key that was encrypted to Bob's ...
    (sci.crypt)
  • CryptoAPI problem
    ... machine imports the public key, ... exchange pair) 3DES key, I get ERROR_INVALID_PARAMETER.. ... "target" machine when it gets the block size to encrypt the data. ... It seems like my session key must be bad somehow? ...
    (microsoft.public.platformsdk.security)