Hi,
I am a newbie with cryptoPP
I am trying to decrypt a string that was crypted in RSA
but it doesn't work, I have an exception that say "Invalid ciphertext",
in my program the RSA private key was succesfully loaded, but when the
program try to decrypt the ciphertext it doesn't work
I am sure that the ciphertext is Ok, so I don't understand, I need help
please
here my source code:
std::string Crypto::RSADecryptString( const char *privKey, const char
*ciphertext){
//privKey is the privateKey, in hexadecimal format
StringSource privFile(privKey, true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor priv(privFile);
//here we try to decrypt a ciphertext, here ciphertext is in
hexadecimal format
RandomPool randomPool;
string result;
StringSource(ciphertext, true, new HexDecoder(new
PK_DecryptorFilter(randomPool, priv, new StringSink(result))));
return result;
}
can you send me a source code who explain the encryption/decryption method
for RSA ?
thanks