Diffie-Hellman Key Exchange Demo
Watch Diffie-Hellman agree on a secret in your browser with toy numbers. A teaching demo only — never a real channel.
What this diffie-hellman key exchange demo does
The page runs the exchange with BigInt square-and-multiply on the toy defaults: p twenty-three, g five, secrets six and fifteen, giving public values eight and nineteen and the shared secret two on both sides, printed so the agreement is visible. Every run carries a demo-only line, because small numbers teach and do not protect. A p that is not prime, a g at or above p or at or below one, and secrets below one are each refused naming the rule.
How to use it
Diffie-Hellman Key Exchange Demo: paste the note into the box above, set Prime modulus (p), default "23", Base (g), default "5", Secret A (a), default "6" and Secret B (b), default "15", and press Run to get the shared secret below.
Worked example
Input:
Output:
A = 8
B = 19
Secret from A side = 2
Secret from B side = 2
DEMO ONLY — small numbers, never a real channel.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads note and returns shared secret; reloading the page discards both.
The page runs the exchange with BigInt square-and-multiply on the toy defaults: p twenty-three, g five, secrets six and fifteen, giving public values eight and nineteen and the shared secret two on both sides, printed so the agreement is visible. Every run carries a demo-only line, because small numbers teach and do not protect. A p that is not prime, a g at or above p or at or below one, and secrets below one are each refused naming the rule.
Watch Diffie-Hellman agree on a secret in your browser with toy numbers. A teaching demo only — never a real channel.
How to use it
Diffie-Hellman Key Exchange Demo: paste the note into the box above, set Prime modulus (p), default "23", Base (g), default "5", Secret A (a), default "6" and Secret B (b), default "15", and press Run to get the shared secret below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads note and returns shared secret; reloading the page discards both.
What to Expect
Best for
- Converting note to shared secret when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample output
A = 8 B = 19 Secret from A side = 2 Secret from B side = 2 DEMO ONLY — small numbers, never a real channel.
Frequently asked questions
How do I use the diffie-hellman key exchange demo?
Diffie-Hellman Key Exchange Demo: paste the note into the box above, set Prime modulus (p), default "23", Base (g), default "5", Secret A (a), default "6" and Secret B (b), default "15", and press Run to get the shared secret below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.