python diffie hellman

Solutions on MaxInterview for python diffie hellman by the best coders in the world

showing results for - "python diffie hellman"
Athene
20 Feb 2017
1import pyDH
2d1 = pyDH.DiffieHellman()
3d2 = pyDH.DiffieHellman()
4d1_pubkey = d1.gen_public_key()
5d2_pubkey = d2.gen_public_key()
6d1_sharedkey = d1.gen_shared_key(d2_pubkey)
7d2_sharedkey = d2.gen_shared_key(d1_pubkey)
8
9print(d1_sharedkey == d2_sharedkey)
10
11print(d1_pubkey,'\n',d2_pubkey)
12print(d1_sharedkey,' and ',d2_sharedkey)