Diffie-Hellman key exchange

Two parties who have never met agree on a secret over a public channel by publishing $g^a \bmod p$ and $g^b \bmod p$ and each raising the other's number to their own secret to get $g^{ab} \bmod p$, which an eavesdropper cannot find but a man in the middle can hijack unless the exchange is authenticated.

From Computer Networks and Security.