{
  "slug": "diffie-hellman",
  "name": "Diffie-Hellman",
  "aka": "Finite-field DH and DHE; MODP and FFDHE groups",
  "group": "key-establishment",
  "kind": "Key agreement",
  "summary": "Finite-field Diffie-Hellman is broken by Shor's algorithm. Its replacement is ML-KEM run as an ephemeral key exchange, deployed so far in hybrid with a classical exchange.",
  "used_in": "IKEv2 and IPsec, SSH, TLS 1.2 with DHE, and the FFDHE groups of TLS 1.3.",
  "problem": "Discrete logarithm in a finite field",
  "quantum": "broken",
  "attack": "Shor's algorithm",
  "exposure": "Shor's algorithm computes discrete logarithms in polynomial time. An attacker who recorded a handshake recovers the session keys from the two public values. Forward secrecy does not help: it protects against later theft of a long-term key, not against solving the exchange itself.",
  "recorded": "Exposed. Recorded handshakes yield the session keys.",
  "out_label": "Ciphertext or share",
  "sizes": [
    {
      "label": "2048-bit group",
      "pk": 256,
      "out": 256
    },
    {
      "label": "3072-bit group",
      "pk": 384,
      "out": 384
    }
  ],
  "replace": [
    {
      "slug": "ml-kem",
      "name": "ML-KEM",
      "standard": "FIPS 203",
      "status": "Final",
      "standardized": true,
      "note": "Run as an ephemeral exchange: the initiator sends an encapsulation key and the responder returns a ciphertext.",
      "page": "https://quantum.zksecurity.xyz/algorithms/ml-kem/"
    }
  ],
  "alternatives": [
    {
      "slug": "hqc",
      "name": "HQC",
      "standard": "FIPS (no number yet)",
      "status": "Selected, in development",
      "standardized": false,
      "note": "Selected by NIST as the second KEM, on a code-based assumption. No standard or draft yet.",
      "page": "https://quantum.zksecurity.xyz/algorithms/hqc/"
    },
    {
      "slug": "frodokem",
      "name": "FrodoKEM",
      "standard": "ISO/IEC (in progress)",
      "status": "Recommended by BSI and ANSSI; not selected by NIST",
      "standardized": false,
      "note": "Unstructured lattices, at the cost of keys and ciphertexts of 10 to 20 KB. Recommended by BSI and ANSSI.",
      "page": "https://quantum.zksecurity.xyz/algorithms/frodokem/"
    }
  ],
  "protocols": [
    "draft-ietf-ipsecme-ikev2-mlkem",
    "RFC 10042",
    "RFC 10024",
    "draft-ietf-tls-mlkem"
  ],
  "changes": [
    "A KEM is not symmetric between the parties. One side generates a key pair and the other encapsulates to it, so the order of messages is fixed where Diffie-Hellman allowed either.",
    "IKEv2 adds ML-KEM as an additional key exchange next to the classical one (RFC 9370).",
    "ML-KEM-768 sends 1,184 bytes one way and 1,088 the other, against 256 each way for a 2048-bit group.",
    "Static Diffie-Hellman keys and non-interactive key agreement have no standardized replacement: see ECDH."
  ],
  "specified": [
    {
      "title": "RFC 7919, FFDHE groups for TLS",
      "url": "https://www.rfc-editor.org/info/rfc7919"
    },
    {
      "title": "NIST SP 800-56A Rev. 3",
      "url": "https://csrc.nist.gov/pubs/sp/800/56/a/r3/final"
    }
  ],
  "references": [
    {
      "title": "RFC 9370, Multiple Key Exchanges in the Internet Key Exchange Protocol Version 2 (IKEv2)",
      "url": "https://www.rfc-editor.org/info/rfc9370"
    }
  ],
  "tags": [
    "rsa-ecc"
  ],
  "timelines": [
    "nist-ir-8547",
    "cnsa-2-0",
    "australia-asd-ism"
  ],
  "page": "https://quantum.zksecurity.xyz/replacements/diffie-hellman/",
  "reviewed": "2026-11-25",
  "standing": "standardized replacement"
}
