Diffie-Hellman for a key exchange
Built for k-12 students learning it in middle or high school. Watch the idea come alive with plain-language steps and everyday examples — perfect for projects and homework. Simulate a key exchange 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 k-12 students?
- Yes — this version of "Diffie-Hellman for a key exchange" is framed for k-12 students learning it in middle or high school. Watch the idea come alive with plain-language steps and everyday examples — perfect for projects and homework.
- Do I need to install anything?
- No. It runs in any modern browser, free, with no account required.