Hi,

I copied the functions RSAEncryptString and RSADecryptString from
test.cpp and I'm currently having problems running the
RSADecryptString function. I'm using a slightly modified version (I'm
using StringSource instead of FileSource):

string RSADecryptString(const string privateKey, const string
ciphertext)
{
        StringSource privString(privateKey, true, new HexDecoder);
        RSAES_OAEP_SHA_Decryptor priv(privString);
        string result;
        StringSource(ciphertext, true, new HexDecoder(new
PK_DecryptorFilter(GlobalRNG(), priv, new StringSink(result))));
        return result;
}

I'm generating public and private keys using the function
GenerateRSAKey(), also from test.cpp.

When I run this function, I get the following error: Unhandled
exception at 0x0080f657 in cryptest.exe: 0xC0000005: Access violation
reading location 0x00000008.

It breaks at StringSource(ciphertext,....) and I just can't figure out
why. Could it be the length of the keys, cos I had a similar message
when I was trying to encrypt with keyLength=32? Now keyLength=1024.

Any help will be appreciated.
Thanks!

-- 
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