liveBook · Manning

Elliptic-curve diffie-hellman

As explained in Real-World Cryptography

Elliptic Curve Diffie-Hellman is a public-key key exchange method based on elliptic-curve cryptography that lets parties derive a shared secret.

Elliptic Curve Diffie-Hellman (ECDH) lets two parties derive the same shared secret without sending that secret directly. It uses elliptic-curve groups, where recovering a private key from its public key relies on the difficulty of the elliptic-curve discrete logarithm problem. section 5.3 section 5.3.2

A basic ECDH exchange proceeds in named steps:

  • Agree on an elliptic curve equation, a finite field, and a generator or base point G. section 5.3.2
  • Choose a random private value: Alice chooses a and Bob chooses b. section 5.3.2
  • Derive public keys A = [a]G and B = [b]G, then exchange them. section 5.3.2
  • Compute the shared secret as [a]B or [b]A; both calculations produce [ab]G. section 5.3.2
  • Verify received public keys and add authentication when the exchange must resist an active man-in-the-middle attacker. section 5.5

Alice and Bob derive the same secret

Alice publishes A = [a]G and Bob publishes B = [b]G. Alice computes [a]B, while Bob computes [b]A. Because both equal [ab]G, they obtain the same shared secret even though neither sends a or b. section 5.3.2

ECDH offers much smaller parameters than traditional DH at comparable security levels: 256-bit ECDH parameters provide 128 bits of security, compared with 2,048-bit DH parameters. P-256 and Curve25519 are the most widely used curves described here. section 5.3 section 5.5

Curve selection and validation matter. Standardized choices include P-256 and Curve25519, while invalid received public keys have been a source of many bugs; ECDH is a key exchange, not authentication by itself. section 5.3.3 section 5.5

Figure 5.12 Choosing a private key in ECDH is like choosing an index in a list of numbers produced by a generator (or base point) G. The Elliptic Curve Discrete Logarithm Problem (ECDLP) is to find the index from the number alone.

Visualize private-key selection as choosing an index in values generated from the base point G, then compare the public value with the hidden index. section 5.3.2

How Real-World Cryptography covers it

How deep it goes
Explains parameter agreement, key generation, scalar operations, shared-secret equality, security assumptions, and key validation.
Examples
Uses Alice and Bob, base point G, P-256, Curve25519, and visual comparisons between ordinary DH and elliptic-curve groups.
What it assumes
Builds from Diffie-Hellman groups and introduces elliptic-curve group operations as an alternative to modular multiplication.
What you can do after
Apply ECDH by selecting standardized curves, deriving matching shared secrets, validating public keys, and adding authentication where required.
How it connects
Connects Diffie-Hellman, elliptic-curve cryptography, discrete logarithm problems, public-key authentication, and hybrid encryption.

Also explained in

Compare how 3 books explain elliptic-curve diffie-hellman →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.