>
> Hi,
>
> I have a doubt here regarding the length in bits for shared secret key
> generated using Diffie-Hellman, hope someone could kindly clear my doubt
> :)
>
> In "DH *DH_generate_parameters(int prime_len, int generator, void
> *callback, char *cb_arg)", the first argument is the length in bits for
> the prime number to be generated in order for subsequent calculation of
> the shared secret key. I have a doubt here. Let say I want to generate
> a 128 bits (16 bytes) shared secret key, so I pass the value 128 to the
You can't specify the length you want the shared secret to be generated.
In fact, you can't specify nothing for shared secret except to negotiate
with your party which DH keypair to choose if you and/or your party
have not the only one. However you are free to use low-order 128 bits
of the secret generated in your application.
The shared secret is calculated as your party's public DH key power
your secret DH key. Your party will calculate the same with your
public key and his private key.
Vadim Fedukovich
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]