Hi!

I am using rsautl to encrypt some data, and i have a problem with the
size of the key. If i am using a key too small, the data will not
be encrypted. My problem is i do not know, in advance, the size of
the data i have to encrypt. So i would like to generate a key which
is available to encrypt any data, whatever their size. What do i
have to do?

Regards,

Nathalie

PS: Here an example of what i am doing:

~/> openssl genrsa -out privateKey
warning, not much extra random data, consider using the -rand option
Generating RSA private key, 512 bit long modulus
.......++++++++++++
..++++++++++++
e is 65537 (0x10001)

~/> openssl rsautl -in data -out dataCrypted -inkey privateKey -encrypt
RSA operation error
30212:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key 
size:rsa_pk1.c:151:

~/> openssl genrsa -out privateKey 2048
warning, not much extra random data, consider using the -rand option
Generating RSA private key, 2048 bit long modulus
..............................................+++
..............................................................+++
e is 65537 (0x10001)

~/> openssl rsautl -in data -out dataCrypted -inkey privateKey -encrypt


-- 
-----------------------------------------------------------------------
Dr Nathalie Furmento, Research Associate          tel: +44 207-594-8310
Imperial College, Department of Computing         fax: +44 207-581-8024
180 Queen's Gate, London SW7 2BZ, UK     email: [EMAIL PROTECTED]
                                    web: http://www.doc.ic.ac.uk/~nfur/
-----------------------------------------------------------------------
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to