Course contentsShow
← Security
Lesson 165 of 3,0524. Asymmetric Cryptography and PKIFree lesson

ECDH (Elliptic Curve Diffie-Hellman)

Implementing key exchange protocols using elliptic curve cryptography for secure shared secrets.

ECDH (Elliptic Curve Diffie-Hellman)

What you'll learn: How to implement secure key exchange using elliptic curve cryptography to establish shared secrets between parties.

What Is ECDH?

ECDH is the elliptic curve version of the Diffie-Hellman key exchange protocol you learned earlier. Instead of using modular exponentiation with large prime numbers, ECDH uses elliptic curve point multiplication to achieve the same goal: two parties exchange public information over an insecure channel and independently compute the same shared secret, without ever transmitting that secret.

How ECDH Works

Think of it like mixing paint colors: Alice has a private color (her private key), Bob has his own private color (his private key), and they both start with a common base color (the agreed-upon elliptic curve and generator point).

  1. Alice multiplies the generator point by her private key: Public_A = private_A × G
  2. Bob multiplies the generator point by his private key: Public_B = private_B × G
  3. They exchange their public points over the network
  4. Alice computes: Shared = private_A × Public_B
  5. Bob computes: Shared = private_B × Public_A

Both arrive at the same shared point because: private_A × (private_B × G) = private_B × (private_A × G)

Why ECDH Matters

ECDH provides the same security as traditional Diffie-Hellman but with much smaller keys (256-bit ECC ≈ 3072-bit RSA). This makes it ideal for resource-constrained environments and modern protocols like TLS 1.3, which rely heavily on ECDH for forward secrecy.

Key Takeaway: ECDH uses elliptic curve point multiplication to let two parties establish a shared secret over an insecure channel, providing strong security with smaller keys than traditional Diffie-Hellman.