On Wednesday 03 September 2003 04:59, Bala Pitchandi wrote: > Hello, > > 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 > and for a given P, g & pub_key, I would get the same shared secret key? Which public key ? If you take the same parameters (p,g) and the same private/public key and the same second public key DH_compute_key would return the same shared secret key. > > For some reason in my test code, where I use DH_generate_key() followed by > DH_compute_key(), I get different values everytime I execute the test. Here > are the values of P & g I am using: > > P: > FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B1 >3 > 9B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B57 >6 625E7EC6F44C42E9A63A3620FFFFFFFFFFFFFFFF > > g: 2 > > 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. Nils ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]