Is it true that for a given P & g, I would always get the same public key
No, the private key is (should be) a random number => you get a different public key for each invocation of DH_generate_key
Not quite, no. In fact, DH would be pretty useless if that were the case. See my code snippet, if you fill in the private exponent (which is what I assume you mean by private key), you'll always get the same public exponent if the private exponent is the same.
What could be the possible problem where I am getting a different secret & pub_key every time?
Perhaps you should read a textbook about cryptography.
I think the problem may be the less-than-intuitive API.
______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
