Hello all
Well, I've been going through my personal hell these days
I am having some trouble decrypting a message that was encrypted using RSA and I'm always failing with a "RSA/OAEP-MGF1(SHA-1): invalid ciphertext"
I have a private key encoded in base64 and I load it:
RSA::PrivateKey private_key; StringSource file_pk(PK,true,new Base64Decoder); private_key.Load( file_pk );
I then proceed to decode the message by doing:
RSAES_OAEP_SHA_Decryptor decryptor(private_key); AutoSeededRandomPool rng; string result; StringSource(ciphertext, true, new PK_DecryptorFilter(rng, decryptor, new StringSink(result) ) );
As far as I can tell, the message should be being parsed without any problems. ciphertext is an std::string, so no \0 at the end that could do something unexpected.
I just though of something, and what if the private key is incorrect but can be loaded anyway without throwing a BER decode error. What would that throw when decrypting?
Hope that anyone can shed some light on this.
Cheers