Hi,

Usually, one doesn't encrypt data with an RSA key. What is really
encrypted with an RSA is a secret key (generated at random). The secret
key is used to encrypt your data, using a symetric cipher (blowfish,
3DES, IDEA, whatever).

On Wed, 28 Mar 2001, Nathalie Furmento wrote:

> 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
>
>
>

-- 
Erwann ABALEA
[EMAIL PROTECTED]
RSA PGP Key ID: 0x2D0EABD5
-----
Architect: Someone who knows the difference between that which could
be done and that which should be done.
                                     Larry McVoy

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

Reply via email to