Diffie-Hellman is a very simple algorithm which can be used to establish a shared secret between two parties.
How it works
Robot A use its private number a
to generate value A
and pass it to Robot B along with value g
and p
. Value g
, p
and A
are all public. Robot B uses the same formula to generate value B
using its private value b
then transfers value B
to Robot A. After all of that, Robot A and B can get same value R
without exposing its private values to others.
Usage of D-H and Concept Behind
During the network communications, data can be eaily exposed to attackers. D-H provides a fantastic solution for that. Using D-H algorithm, users can estalish a secret even through public channels.
The key concept of this algorithm is Trapdoor Function
which is widely used in cryptography. In this case, f(x)=g^x mod p
is a Trapdoor Function
, f(x) can be easily calculated when x is given but the computation of the inverse of f can hardly be done.