Dear all,

I was wondering what key size checks really make sense for a
Diffie-Hellman calculation.

DH_size() checks the size of Dh->p using BN_num_bytes(). Is it correct
that the main intention is to know the size required for storing a copy
of Dh->p, in other words: this is not a security feature?

For checking Dh->priv_key and Dh->pub_key, does it make sense to call
BN_num_bytes() on them and check if they are really 1024/8 for 1024 bit
keys? I would think that a private or public key which has the highest 8
bits set to 0 is no less secure that any other. On the other hand,
excluding such keys would limit the size of the key space?

I guess the NOTES section of the BN_num_bytes(3SSL) man page says
something similar. Is this true or am I completely mistaken?

Thanks for your help,

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

Reply via email to