crypto++ 5 and RSA encryption/decryption problem



Hello

I'm trying to implement encryption/decryption using RSA. The problem is that all samples I have found in the Internet refer to crypto++ version 4.x.

Version 5 have important changes, for example the sample code below (found on codeproject.como) doesn't work at all:

FileSource privFile(privFilename, true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor priv(privFile);

HexDecoder hexDecoder;
hexDecoder.Put((byte *)ciphertext, strlen(ciphertext));
hexDecoder.MessageEnd();
SecByteBlock buf(priv.CipherTextLength());
hexDecoder.Get(buf, priv.CipherTextLength());

char *outstr = new char[priv.MaxPlainTextLength()+1];
unsigned messageLength = priv.Decrypt(buf, (byte *)outstr);
outstr[messageLength] = 0;
CString csRet(outstr);
delete [] outstr;
return csRet;

becuase methods like CipherTextLength, MaxPlainTextLength and Decrypt do not exist anymore (unless I'm doing something wrong).

The tutorial on the project's website still refers to version 4.x. I'm stuck. Please advise.

Thanks
si


.