Help on Diffie Hellman key exchange

Jason Qian jqian at tibco.com
Wed Nov 13 17:23:37 UTC 2019


Thanks Rich and Tomas,

Here is the code for creating the key (openssl-0.9.8h)

int AESCipher::createKey(unsigned char *buf, int keySize) {
char seed[256];
::sprintf(seed, "%ldXXX_XXX_H__xxxxx_xxxx_xxx_xxxxx_xxxxxxx__INCLUDED_",
MiscUtils::generateId());
RAND_seed(seed, ::strlen(seed));

RAND_bytes(buf, keySize / 8);
return keySize / 8;
}

For using 1.1.0, we only need to call RAND_bytes() ?

Jason









On Wed, Nov 13, 2019 at 12:11 PM Salz, Rich <rsalz at akamai.com> wrote:

> *>*    RAND_seed(seed, ::strlen(seed));
> >    RAND_bytes(buf, keySize / 8);
>
>
>
> I don’t know where you are getting the seed, but it is typically binary
> data, not a C string.
>
>
>
> If you are using 1.1.0 or later, you do not need to seed things.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20191113/f7062a4f/attachment-0001.html>


More information about the openssl-users mailing list