Diffie-Hellman

A method that lets two parties agree on a shared secret key over a public network, even while an eavesdropper sees every message they exchange.

In more detail

Each side picks a private number, sends a public value computed from it, then combines the other side's public value with its own private number, and both arrive at the same secret. An eavesdropper sees only the public values, and working backwards, the discrete logarithm problem, is infeasible at proper sizes such as 2048-bit groups. On its own it does not prove who is on the other end, so it must be authenticated, usually with signatures and certificates, to stop a man-in-the-middle attack.

Examples

A = pow(G, a, P)           # Alice sends this in the clear
alice_secret = pow(B, a, P)  # Bob's public value, Alice's private one
same secret: True

Related terms

Taught in

References