On Thu, May 27, 2010 at 2:20 PM, Chuck Pareto <[email protected]> wrote:
> Hi,
> I'm still unsure as to the max length string I can use to encrypt. I'm using
> the rsacrypto class in .net to encrypt.
> I know I can't pass in a string that's 256 bytes long or greater because
> there us an exception that gets thrown. But as I work my way back in length
> I still get exceptions with string lengths smaller than 256.

If it's using PKCS1 padding (most common), then the max length is 11
bytes less than the key size, so 256-11.

But like David said, you shouldn't be using public-key encryption
directly unless you know what you're doing.  The normal approach is to
use symmetric encryption (e.g., AES) to encrypt the data, and PK
encryption for encrypting the symmetric key.

Phillip
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to