Read this lesson as text

ECDH Key Exchange

Cryptography · Axiom Academy

Elliptic Curve Diffie-Hellman: Secure Key Agreement Using Point Multiplication Before Alice and Bob can exchange keys, they must agree on public parameters that define the elliptic curve cryptosystem. An elliptic curve E defined over a finite field (typically specified by an equation) A base point G on the curve with a large prime order n These parameters are public and can be shared openly. Common standards like NIST P-256 or Curve25519 specify these values. The base point G generates a cyclic subgroup of order n , meaning that nG = O (the point at infinity). The security of ECDH depends on choosing n to be a large prime. 2. Key Generation and Exchange Alice and Bob each generate their own private-public key pairs and exchange their public keys. Alice chooses a random secret integer a (where 1 < a < n ) Alice computes her public key: A = aG (point multiplication) Bob chooses a random secret integer b (where 1 < b < n ) Bob computes his public key: B = bG (point multiplication) Alice and Bob exchange their public keys A and B over the insecure channel At this point, Alice knows a and B , while Bob knows b and A . An eavesdropper knows G , A , and B , but not the secrets a or b . 3. Computing the Shared Secret Both parties can now independently compute the same shared secret point without ever transmitting it. Alice computes: S = aB (multiplying Bob's public key by her secret) Bob computes: S = bA (multiplying Alice's public key by his secret)

This is the written version of the interactive lesson above. See the full Cryptography course.