Browse the glossary using this index

Special | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ALL
Picture of Yee Wei Law

Diffie-Hellman key agreement

by Yee Wei Law - Tuesday, 30 May 2023, 11:21 PM
 

The Diffie-Hellman (D-H) key agreement (often called β€œkey exchange”) protocol is standardised in NIST SP 800-56A [BCR+18].

The protocol originated in the seminal 1976 paper by Whitfield Diffie and Martin Hellman [DH76], both recipients of the 2016 Turing Award (their contribution took 40 years to be recognised).

Protocol between πŸ‘© Alice and πŸ§” Bob [KL21, CONSTRUCTION 11.2] in Fig. 1:

  1. On input of security parameter , πŸ‘© Alice runs probabilistic polynomial-time (PPT) algorithm to obtain the domain parameters , where is a cyclic group of prime order , and is a generator of .

    The bit-length of = the security parameter .

    The domain parameters can be pre-distributed.

  2. πŸ‘© Alice chooses , , uniformly at random, and computes .

    is the (cyclic) group of integers modulo .

    πŸ‘© Alice’s (ephemeral) private key and public key are and respectively.

  1. πŸ‘© Alice sends to πŸ§” Bob.
  2. πŸ§” Bob chooses , ,  uniformly at random, and computes .

    πŸ§” Bob’s (ephemeral) private key and public key are and respectively.

  3. πŸ§” Bob sends to πŸ‘© Alice and outputs .
  4. πŸ‘© Alice computes .

Successful completion of the protocol results in the session key .

Fig. 1: The D-H key agreement protocol [KL21, FIGURE 11.2].

A necessary condition for preventing a probabilistic polynomial-time (PPT) eavesdropper from computing the session key is that the computational Diffie-Hellman (CDH) problem is hard:

Definition 1: Computational Diffie-Hellman (CDH) problem [Gal12, Definition 20.2.1]

Given the triple of elements of , compute .

However, the hardness of the CDH problem is not sufficient.

Just as indistinguishability plays an essential role in symmetric-key encryption, indistinguishability is key here: if the session key is indistinguishable from an element chosen uniformly at random from , then we have a sufficient condition for preventing a PPT eavesdropper from computing the session key [KL21, pp. 393-394].

The indistinguishability condition is equivalent to the assumption that the decisional Diffie-Hellman (DDH) problem is hard:

Definition 2: Decisional Diffie-Hellman (DDH) problem [Gal12, Definition 20.2.3]

Given the quadruple of elements of , determine whether or not.

The DDH problem is readily reducible to the CDH problem, since any algorithm that solves the CDH can compute and compare it with ; implying the DDH problem is no harder than the CDH problem.

In turn, the CDH problem is reducible to the discrete logarithm problem (DLP, see Definition 3), since any algorithm that solves the DLP can compute from , from , and hence ; implying the CDH problem is no harder than the DLP problem.

Definition 3: Discrete logarithm problem (DLP) [Gal12, Definition 13.0.1]

Given , where is a multiplicative group, find such that .

In other words, the DDH problem can be reduced to the CDH problem, which in turn can be reduced to the DLP; solving the DLP breaks the D-H key agreement protocol.

⚠ There are multiplicative groups for which the DLP is easy, so it is critical that the right groups are used.

A safe-prime group is a cyclic subgroup of the Galois field with prime order , where is called a safe prime; this subgroup has elements [BCR+18, Sec. 5.5.1.1].

NIST [BCR+18, Appendix D] refers to RFC 3526 and RFC 7919 for definitions of safe-prime groups.

The D-H key agreement protocol is used in the Internet Key Exchange (IKE) protocol, which is currently at version 2 [KHN+14].

References

[BCR+18] E. Barker, L. Chen, A. Roginsky, A. Vassilev, and R. Davis, Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography, Special Publication 800-56A Revision 3, NIST, April 2018. https://doi.org/10.6028/NIST.SP.800-56Ar3.
[DH76] W. Diffie and M. Hellman, New directions in cryptography, IEEE Transactions on Information Theory 22 no. 6 (1976), 644–654. https://doi.org/10.1109/TIT.1976.1055638.
[Gal12] S. D. Galbraith, Mathematics of Public Key Cryptography, Cambridge University Press, 2012. https://doi.org/10.1017/CBO9781139012843.
[KL21] J. Katz and Y. Lindell, Introduction to Modern Cryptography, 3rd ed., CRC Press, 2021. Available at https://ebookcentral.proquest.com/lib/unisa/detail.action?docID=6425020.
[KHN+14] C. Kaufman, P. E. Hoffman, Y. Nir, P. Eronen, and T. Kivinen, Internet Key Exchange Protocol Version 2 (IKEv2), RFC 7296, October 2014. https://doi.org/10.17487/RFC7296.