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

Elliptic Curve Diffie-Hellman (ECDH)

How Diffie-Hellman works over elliptic curves, providing equivalent security with smaller key sizes.

Elliptic Curve Diffie-Hellman (ECDH)

What you'll learn: How Diffie-Hellman works over elliptic curves, providing equivalent security with smaller key sizes.

The Core Idea

You already know how Diffie-Hellman key exchange works using modular arithmetic and the discrete logarithm problem. Elliptic Curve Diffie-Hellman (ECDH) applies the exact same concept, but instead of working with exponentiation in modular arithmetic, it works with point multiplication on elliptic curves.

The beauty? ECDH provides the same security strength as traditional Diffie-Hellman but with dramatically smaller keys.

How ECDH Works

Instead of:

  • Choosing a large prime and generator (traditional DH)
  • Computing g^a mod p and g^b mod p

ECDH uses:

  • An agreed-upon elliptic curve and base point
  • Computing point multiplication: a·G and b·G (where G is the base point)
  • Both parties can compute the same shared secret: a·(b·G) = b·(a·G)

The mathematical difficulty of finding the private key from a public point (the elliptic curve discrete logarithm problem) is even harder than the traditional discrete logarithm problem, which is why smaller keys work.

The Key Size Advantage

A 256-bit ECDH key provides roughly the same security as a 3072-bit traditional Diffie-Hellman key. This means:

  • Faster computations
  • Less bandwidth for transmitting public keys
  • Reduced storage requirements
  • Better performance on mobile and IoT devices

ECDH is the foundation of modern TLS connections (especially with ephemeral variants like ECDHE for forward secrecy) and is widely used in secure messaging applications.

Key Takeaway: ECDH applies Diffie-Hellman key exchange to elliptic curves, achieving equivalent security with 8-12 times smaller key sizes, making it the preferred choice for modern systems.