Diffie-Hellman protocol is used for key exchange over an unsecure channel. The algorithm guarantees that even if the channel is eavesdropped, the attacker will not be able to reconstruct the exchanged key. The key might be for example later used for symmetric cryptography.


The algorithm is based on associativeness of the power operation.

 {(A^B)}^C = {(A^C)}^B

Respectively, on the modular variant of the formula.

 \\vert {(A^B)}^C \\vert _{m} = \\vert {(A^C)}^B \\vert _{m}
Communication of three participants using Diffie-Hellman protocol
Communication of three participants using Diffie-Hellman protocol

However is the calculation of the resulting value fast, it is very difficult to find out the one of the private values known only by some participant of the handshake. This principle, on which the security of the protocol is based, is called discrete logarithm problem.


  1. The participants publically agree on a common modulo m and base z.
  2. Each participant generates his private key – an exponent coprime to m.
  3. Each participant powers the base to the private exponent a passes the result to the next participant.
  4. The algorithm terminates, when each of the original bases is processed by each participant.


Place for your banner

Here is the position ready for our customer's banners.