[EMAIL PROTECTED] wrote:
> 
> With reference to rsa.h,
> I found that there are four kinds of padding.
> Of them, My concern is about RSA_NO_PADDING and RSA_PKCS1_PADDING.
> 
> Basic assumption here is,
> 1. RSA Key size : 256
> 2. size of message to be encrypted : 33
> 

With a keysize of 256 bits the maximum length of data that can be
handled is 256/8 = 32 bytes in the no padding case. For PKCS#1 padding
the maximum is 32-11 = 21 bytes. So you can't encrypt a 33 byte message
with a 256 bit key. You need a larger key size.

256 bits is horribly insecure anyway.

These limits are set by the RSA algorithm itself and its not just an
arbitrary OpenSSL limitation.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to