Diffie-Hellman Key Exchange

Diffie-Hellman (DH) is a cryptographic protocol that allows two parties to establish a shared secret over an insecure channel. It relies on the computational difficulty of the Discrete Logarithm Problem (DLP) in a cyclic group.

Protocol Mechanism

Given a public cyclic group  where the DLP is hard:

  1. Alice samples a private integer  and sends public value .
  2. Bob samples a private integer  and sends public value .
  3. Key derivation: Both parties compute the shared secret .
    • Alice computes: 
    • Bob computes: 

Security Properties

  • Hardness Assumption: An attacker observing  and  cannot compute  without solving the Computational Diffie-Hellman (CDH) problem, which is related to the Discrete Logarithm Problem.
  • Perfect Forward Secrecy (PFS): If the private exponents  and  are ephemeral (generated on the fly for each session and then discarded), a compromise of long-term keys in the future will not compromise past session keys.

Critical Limitation

  • Lack of Authentication: Basic DH is anonymous. It is vulnerable to Man-in-the-Middle (MITM) attacks because neither party verifies the identity of the other.
  • Mitigation: The exchange must be authenticated (e.g., using Digital Signature Schemes or public key infrastructure) to prevent an attacker from intercepting and replacing values.

Relevant Note(s):