Re: crypto++ 5 and RSA encryption/decryption problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


sci.crypt archive

Re: crypto++ 5 and RSA encryption/decryption problem

From: <tomstdenis@gmail.com>
Date: Fri Mar 31 2006 - 17:36:00 CEST

I don't think the author reads this group. Consider also emailing him
directly.

Tom

si wrote:
> 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
Received on Mon May 1 01:54:12 2006