Run the full Diffie–Hellman exchange over q = 541 with α = 2, print both public values and both independently computed keys, and assert that they match.
Run the full Diffie–Hellman exchange over q = 541 with α = 2, print both public values and both independently computed keys, and assert that they match.
Answer
q, alpha = 541, 2 XA, XB = 97, 233 YA = pow(alpha, XA, q) YB = pow(alpha, XB, q) KA = pow(YB, XA, q) KB = pow(YA, XB, q) assert KA == KB print(YA, YB, KA, KB)
Stallings & Brown 5e ch2 §2.3; ch21 §21.5