Hi all,
i'm new to cryptopp and i'm learning to use RSA algorithms.
Actually i've got this code.
It appears to work fine, but only with strings. Now, i want this code
to crypt any byte array. Can anybody help me? thanks.
//--------------------------------------------------------------------------------//
const char * cryptRSA(const char *pubFilename, const char *seed, const
byte message size_t messageLen)
{
StringSource string1(pubFilename, true, new HexDecoder);
RSAES_OAEP_SHA_Encryptor pub(string1);
RandomPool randPool;
randPool.Put((byte *)seed, strlen(seed));
string result;
StringSource(message, messageLen, true, new
PK_EncryptorFilter(randPool, pub, new HexEncoder(new
StringSink(result))));
return result.c_str();
}
//--------------------------------------------------------------------------------//
const char * decrypt char *privFilename, const char *ciphertext)
{
StringSource string1(privFilename, true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor priv(string1);
string result;
StringSource(ciphertext, true, new HexDecoder(new
PK_DecryptorFilter(GlobalRNG(), priv, new StringSink(result))));
return result.c_str();
}
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---