Diffie–Hellman Key Exchange

Whitfield Diffie & Martin Hellman, 1976

O(k³)

Introduced in 1976, Diffie–Hellman lets two parties agree on a shared key over an insecure channel using modular exponentiation. Both agree on public p and g. Each picks a private exponent, exchanges g^private mod p, and computes the same shared key. This walkthrough uses small integers for clarity; real deployments use large safe primes and additional authentication.