In 1976 the Diffie-Hellman key exchange protocol was developed. This early advancement in network security was designed to allow users to communicate securely over an insecure medium. It was also the first known use of public-key cryptography.The Diffie-Hellman method was not designed to encrypt communications over a line. Rather it was developed to transmit a session key over the insecure medium. The session key could then be used to properly encrypt the rest of the messages to be sent. The session key would more than likely be a symmetric encryption algorithm, because asymmetric algoithms are quite slow.

The steps for completing the protocol are as follows:
  1. The two communicating parties, Alice and Bob will decide on two numbers. One number, P is a large prime number. The second number, I is any integer that is less than P. For this case let's say that P=17 and I=4
  2. Both parties will then generate another number known as the private key. Alice will generate random number a and Bob will generate random number b. All numbers are integers. random number a=15 random number b=6
  3. Both parties will then calculate their unique public keys. Alice's public key is computed with the equation I^a modulo P. Likewise, Bob's public key is computed with I^b modulo P. Alice's public key A = 4^15 mod 17 = 13 Bob's public key B = 4^6 mod 17 = 16
  4. Alice and Bob will then send each other their public keys A and B.
  5. Since each party has acquired the other's public key each will then calculate the session key. Alice will calculate the session key using the following equation. I^ab=(I^b mod P)^a mod P. And Bob will calculate the session key using I^ba=(I^a mod P)^b mod P. I^ab and I^ba are equal and therefore the session key K is known by both parties. Alice solves for K = (16)^15 mod 17 = 16 = K Bob solves for K = (13)^6 mod 17 = 16 = K
The session key would then probably be used as the secret key for a symmetric encryption algorithm like DES.

Of course the above example uses extremely small numbers and would not be secure. However, the actual protocol calls for much larger numbers that in theory are uncrackable by today's encryption standards. Also, the method is subject to the man in the middle attack. Therefore, to make the key exchange secure a trusted third party is needed to verify digital signatures.