The Diffie-Hellman key exchange algorithm allows two users to securely exchange a secret key over an insecure channel. It uses discrete logarithms over finite fields. Each user generates a public/private key pair, and the exchange of the public keys allows both to independently calculate a shared secret key. The security of the algorithm relies on the difficulty of solving the discrete logarithm problem.