Read this lesson as text
ECDH Exchange Example
Cryptography · Axiom Academy
Step-by-step walkthrough of Elliptic Curve Diffie-Hellman key exchange with small numbers Excellent work! You've completed the ECDH key exchange. Here's what we learned: Public Key Generation: Each party multiplies the base point G by their private key to create their public key. Alice computes A = aG and Bob computes B = bG. Secure Exchange: The public keys A and B can be safely transmitted over an insecure channel. An eavesdropper cannot derive the private keys from the public keys due to the discrete logarithm problem. Shared Secret: Both parties arrive at the same shared secret S by combining their private key with the other's public key: Alice computes S = aB = a(bG), while Bob computes S = bA = b(aG). Due to commutativity, both equal (ab)G. Security Foundation: The security of ECDH relies on the difficulty of solving the Elliptic Curve Discrete Logarithm Problem (ECDLP) - given G and aG, finding a is computationally infeasible for large parameters. In practice, ECDH uses much larger curves (like curve25519 or secp256r1) with 256-bit parameters for real-world security. This example uses tiny numbers to illustrate the mathematical principles clearly!
This is the written version of the interactive lesson above. See the full Cryptography course.