Course contentsShow
← Computer Science
Lesson 2415 of 2,87254. Cryptography FundamentalsFree lesson

ECDH and ECDSA

Elliptic curve variants of Diffie-Hellman key exchange and digital signature algorithms.

ECDH and ECDSA

What you'll learn: How elliptic curves provide efficient, modern alternatives to traditional Diffie-Hellman key exchange and digital signatures.

The Core Idea

You've learned about Diffie-Hellman key exchange (where two parties create a shared secret over a public channel) and the mathematical foundations of elliptic curve cryptography. ECDH (Elliptic Curve Diffie-Hellman) and ECDSA (Elliptic Curve Digital Signature Algorithm) are simply elliptic curve variants of classic cryptographic protocols.

ECDH: Key Exchange with Elliptic Curves

Instead of using modular exponentiation with large prime numbers (traditional Diffie-Hellman), ECDH uses point multiplication on elliptic curves:

  1. Alice and Bob agree on a public elliptic curve and a base point G
  2. Alice picks a secret integer a and computes A = a × G (a point on the curve)
  3. Bob picks a secret integer b and computes B = b × G
  4. They exchange their public points A and B
  5. Alice computes a × B while Bob computes b × A — these yield the same shared secret point due to the commutative property

The discrete logarithm problem on elliptic curves makes recovering a or b from the public points computationally infeasible.

ECDSA: Digital Signatures

ECDSA provides authentication and non-repudiation using elliptic curves. It's the elliptic curve equivalent of DSA (Digital Signature Algorithm). A signer uses their private key and the message to generate a signature pair (r, s), which anyone can verify using the signer's public key.

Why Use Elliptic Curve Variants?

Much smaller keys provide equivalent security: a 256-bit ECC key offers roughly the same protection as a 3072-bit RSA key, meaning faster computation and less bandwidth.

Key Takeaway: ECDH and ECDSA bring Diffie-Hellman key exchange and digital signatures to elliptic curves, offering the same security with dramatically smaller keys and better performance.