CyberGlossary

Cryptography

Diffie–Hellman Key Exchange

Also known as: DH, DHKE

Definition

A public-key protocol that lets two parties derive a shared secret over an insecure channel without ever transmitting it, based on the difficulty of the discrete logarithm problem.

Published by Whitfield Diffie and Martin Hellman in 1976, the Diffie–Hellman (DH) key-exchange protocol allows two parties to agree on a shared secret over an untrusted network. Each party picks a private exponent, computes g^x mod p with public parameters (a generator g and large prime p), exchanges the resulting public value, and raises the received value to their own private exponent — both arrive at the same g^xy. Security rests on the computational Diffie–Hellman assumption, related to the discrete logarithm problem. Plain DH provides no authentication and is vulnerable to man-in-the-middle attacks, so production protocols (TLS, IPsec, SSH) authenticate the exchange with signatures or certificates and prefer ephemeral variants (DHE, ECDHE) to deliver perfect forward secrecy. Modern deployments use elliptic-curve forms (X25519, X448) for speed and small messages.

Examples

  • TLS 1.3 mandates (EC)DHE for every handshake to ensure forward secrecy.
  • Signal Protocol uses X3DH, a triple Diffie–Hellman handshake.

Related terms