Diffie-Hellman Key Exchanges

What is Diffie-Hellman?

The Diffie-Hellman key exchange protocol, named after Whitfield Diffie and Martin Hellman, is a protocol for two parties to create a shared secret over a public channel without revealing information about the key.

The exchange is made possible by using commutativity in finite cyclic groups, particularly with elliptic curve cyclic groups. That is to say, given a common generator point on an elliptic curve over a finite field , two parties, Alice and Bob may choose secrets, and respectively, compute their respective elliptic curve points and (again respectively), and exchange these on a public channel. Finally, they may perform the elliptic curve point arithmetic on their received points with their secrets as follows.

Alice:

Bob:

Finally:

As such, Alice and Bob have computed a shared secret by sharing only and over a public channel, which, provided the elliptic curve discrete log problem is intractable, leaks no useful information about .

This protocol is often used to exchange a cryptographic key to be used in a symmetric encryption algorithm and is used in protocols such as SSH, HTTPS, and a variant of it in the Signal Protocol.

What does a Diffie-Hellman Key Exchange look like?

In practice, each of the two parties performs the following.

  1. Generate a local secret with a cryptographically secure pseudorandom number generator.
  2. Add the generator point to itself times via elliptic curve point addition and doubling.
  3. Publish the generated point so the other party can receive it.
  4. Receive the other party's generated point
  5. Add the other party's generated point to itself times via elliptic curve point addition and doubling.
  6. The generated point is the shared secret.

Tripartite Diffie-Hellman

A variant of the Diffie-Hellman key exchange protocol is the tripartite Diffie-Hellman key exchange. There are a few variants with different tradeoffs, but we focus on single-round tripartite Diffie-Hellman, which enables a single transmission from each party, irrespective of ordering.

However, for the single-round tripartite Diffie-Hellman, we use the bilinearity of an elliptic curve pairing. The elliptic curves over which the pairing exists are as above and , which is the same elliptic curve function but with scalars as elements of a polynomial field extension . The ellipitic curve pairing function is , where the output is an element of a polynomial extension field of degree 12. Alice, Bob, and Charlie agree on two generator points and , each chose their respective secret scalar , compute their respective points in both curves and , each transmits their respective pairs: , then on receiving the other two pairs, compute the elliptic curve pairing and exponentiate the result by their own secret.

Alice:

Bob:

Charlie:

Finally:

Note that the ordering of points works out the same, that is to say .

The steps for each party are as follows.

  1. Generate a local secret with a cryptographically secure pseudorandom number generator.
  2. Add the generator point of each curve and to itself times via elliptic curve point addition and doubling.
  3. Publish the generated pair so the other parties can receive it.
  4. Receive the other parties' pairs of generated points and
  5. Compute the ellptic curve pairing (or ).
  6. Exponentiate the output of the elliptic curve pairing to the power of :
  7. The final scalar in is the shared secret.

References

  1. Pairings for Beginners (PDF)