Diffie–Hellman

Lets two parties agree on a secret over a public channel without ever sending it.

Method

Each picks secret a,b; exchange g^a mod p, g^b mod p; shared = g^{ab} mod p.

Applications

TLS handshake, VPNs, messaging.

Advantages

1976; made public-key cryptography possible. 9

Limitations

Vulnerable to man-in-the-middle without authentication; use ECDH + certificates.

Example

Alice a=6, Bob b=15, p=23,g=5 -> both compute 2.

Sources

Educational reference only, not professional advice.

All algorithms