Diffie-Hellman for a public-key handshake
Built for students learning it for a class or exam. See the concept move instead of memorizing formulas — and check your homework intuition. Simulate a public-key handshake live below — adjust the inputs and watch it respond, right in your browser.
Controls
Presets
Diffie-Hellman lets two strangers agree on a secret key while an eavesdropper hears everything. Both share public numbers g and p, each picks a private exponent, and they exchange g raised to it. Raising the other's public value to your own secret yields the same shared key — yet recovering it from the public traffic requires solving the discrete logarithm, which is infeasible.
Data Inspector
Governing equation
Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.
More with Diffie-Hellman
Frequently asked questions
- Is this good for students?
- Yes — this version of "Diffie-Hellman for a public-key handshake" is framed for students learning it for a class or exam. See the concept move instead of memorizing formulas — and check your homework intuition.
- Do I need to install anything?
- No. It runs in any modern browser, free, with no account required.