Diffie-Hellman is used for key agreement. Key agreement is defined as the exchange of information over an insecure medium that allows each of two parties (sender and recipient) to compute a value that will be used to construct a secret key for a symmetric cipher during the rest of the communication. Diffie-Hellman is the first published public key algorithm invented by Whitfield Diffie and Martin Hellman in 1976. Figure 1.7 illustrates how Alice and Bob can agree on key materials using the DH algorithm in the original form. It uses the multiplicative group of integers modulo p, where p is prime. That simply means that the integers between 1 and p - 1 are used with normal multiplication, exponentiation and division, except that after each operation the result keeps only the remainder after dividing by p [4].
The document RFC 2631 [6] describes the requirements (such as minimum size, ranges, prime, etc) on the integers picked in the algorithm.