Dev Tools

Diffie-Hellman Key Exchange Demo

Interactive demo of ECDH (P-256) key exchange showing how two parties derive the same shared secret without ever transmitting private keys. Everything runs in your browser.

Alice
Public Key (hex)
Not generated yet
Shared Secret (256-bit)
Not derived yet
Bob
Public Key (hex)
Not generated yet
Shared Secret (256-bit)
Not derived yet

How it works

This demo uses ECDH on the P-256 curve via WebCrypto. Each party generates a key pair, exchanges public keys, and derives a shared 256-bit secret. The private keys never leave each party. In real protocols this shared secret is used to derive encryption keys.

Was this page helpful?

Related tools