I would like to encrypt a symmetric key with a public key for
efficient encryption.  However, a symmetric key is a byte array and I
can't find a way to encrypt a byte array with a PublicKey.  I know how
to with an AES key

Example for AES Key:
  Decryptor.ProcessData( cbRecoveredText,
 cbCipherText, sizeof( cbCipherText ) );

Here is what I tried but doesn't work:
   ArraySource(byte_array, true, new PK_EncryptorFilter(rng, e, new
HexEncoder(new StringSink(cipher))));

ArraySource only seems to work if you typecast it to a (char *), but
I'm afraid to do this because a char does not have a defined size in c+
+ right?  So wouldn't some parts of the key (byte_array) that I'm
encrypting be typecasted wrong?

Thanks,
Michael

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to