The system...has since become known as Diffie–Hellman key exchange. While that system was first described in a paper by Diffie and me, it is a public key distribution system, a concept developed by Merkle, and hence should be called 'Diffie–Hellman–Merkle key exchange' if names are to be associated with it. I hope this small pulpit might help in that endeavor to recognize Merkle's equal contribution to the invention of public-key cryptography. — Hellman 2002
Both Alice and Bob are now in possession of the group element
Used in ElGamal cipher.
Such construction is not attackable by a passive attacker but someone more active can do it. For this, it is important to sign the conversation (usually with RSA). Ideally the complete exchange.
An interesting idea is to hash the result of the communication before using it further in the protocol.
If we are agreeing on
Attacker can find
The symbol of monsieur Legendre leaks in DH so it is possible
to say if
To avoid falling into some ugly small subgroups we use so-called safe primes.
The multiplicative group of this prime has
We can use a different prime than the one specified above,
but they are pretty much the same.
We will work in a nice group defined by
This is generally something that must be avoided.
Params:
Key setup:
The encryption key can be generated from the decryption — a big difference from RSA. You can’t sign with it.
There is ElGamal signing protocol (used in DSA), different and more complicated than what is described here.