On Wed, Mar 24, 2004, linux guy wrote:

> thx,I am sorry for that i misdescribe my problem,the
> fact is that I can generate 256 RSA key,but I can't create
> certificate with this key,the wrong mesg is as below:
> 20239:error:04075070:rsa routines:RSA_sign:digest too big for rsa key:rsa_sign.c:116:
> 20239:error:0D072006:asn1 encoding routines:ASN1_sign:bad get asn1 object 
> call:a_sign.c:129:
> well,could anyone help me?
> 

This is because the key size is too small for the digest. When you sign a
digest it creates a DigestInfo structure prepends PKCS#1 padding and signs the
result.

The padded result must not exceed the keysize.

For MD5 which is 16 bytes long the DigestInfo structure is 34 bytes in length.
The padding adds a further 11 bytes giving a minimum key size of (34+11)*8 or
360 bits.

There is however an additional requirement for SSL/TLS. Static RSA ciphersuites
are secured by the client sending an encrypted premaster secret using the
servers certified key. This is 48 bytes in length. This means the key length
must be at least (48+11)*8 or 472 bits to meet this requirement.

So the standards require the use of a key of at least 472 bits in length.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to