Exercise 1581Number theory › CongruencesL1Added 3 Nov 2026
The Diffie–Hellman protocol
#Diffie-Hellman#cryptography#modular
Statement
Describe the Diffie–Hellman key exchange and explain its security relies on the discrete logarithm problem.
Hint
Alice and Bob each choose a secret exponent and exchange and .
Show solutionHide solution
Solution
Setup. Public prime and primitive root mod .
Protocol.
1. Alice picks secret , sends to Bob.
2. Bob picks secret , sends to Alice.
3. Alice computes ; Bob computes . Shared key: .
Security. An eavesdropper sees and must compute from these, which requires solving the discrete logarithm problem (finding from ), believed to be hard.
Conclusion. Diffie–Hellman relies on modular arithmetic and the hardness of discrete logarithm.