The Same Idea, Different Math
ECDH is Diffie-Hellman, but using elliptic curves instead of modular exponentiation.
The goal is the same: create a shared secret over a public channel.
The Setup
Alice and Bob agree on:
- An elliptic curve
- A generator point
These are public. Everyone knows them.
The Protocol
Alice’s side:
- Pick a secret number (her private key)
- Compute (her public key)
- Send to Bob
Bob’s side:
- Pick a secret number (his private key)
- Compute (his public key)
- Send to Alice
Creating the Shared Secret
Alice computes:
Bob computes:
Both get the same point .
Why It Works
Scalar multiplication is commutative:
The order doesn’t matter. Both paths lead to the same point.