Proof of the Diffie-Hellman Key Exchange Algorithm
Buildup
From left to right, let’s call them Alice, Bob, and Eve. Alice and Bob are the parties exchanging messages, and Eve is a passive attacker interested in the messages. The orange box denotes information known only to Alice, the sky-blue box denotes information known only to Bob, and the black box denotes information that is public (also known to Eve).
Alice and Bob intend to exchange messages under the cryptography system . Unfortunately, Eve knows the decryption function and cannot directly transmit the key without Eve finding out. However, if in this situation, Alice and Bob can each generate a key that only the two of them share, Eve would not be able to decrypt the ciphertext despite knowing because she does not know the key . This solution is exactly the Diffie-Hellman Key Exchange Algorithm.
Algorithm 1
Let be a cyclic group with elements.
Step 1.
A very large prime number and , which is a large prime number, are chosen and made public.
Step 2.
Alice picks an arbitrary integer , and Bob picks an arbitrary integer .
Step 3. Encryption
and are calculated and made public.
Step 4. Decryption
By using the cipher encrypted with as the key, is computed, and Eve realistically cannot know , so she cannot know .
Description
In Step 1., serves as the order, which should be as large a prime as possible so that makes it difficult to predict changes depending on . If it only reaches about , calculating becomes too easy. If is a composite number, then when it’s said that , it means ; hence it’s essentially the same as using , which is a smaller order.
It’s important to note that the Diffie-Hellman key exchange algorithm itself does not become some cryptographic system but is merely a method for Alice and Bob to create a secret key in the presence of a passive attacker. The obtained in this way is unrelated to the message, and the cryptographic system does not change at all.
Proof
Decryption
Alice and Bob, knowing and , can easily compute Therefore, with the public , knowing either or is enough to find .
■
Encryption
Since Eve only knows and , not and , she has to solve the discrete logarithm problem or . This is very difficult, so Alice and Bob can communicate securely from Eve using as the key.
■
See Also
Security algorithms utilizing the difficulty of the discrete logarithm problem
Attack algorithms for the discrete logarithm problem
- Shanks’ algorithm
- Pollard’s rho algorithm for logarithms
- Conditions under which the discrete logarithm problem is easily solvable
Hoffstein. (2008). An Introduction to Mathematical Cryptography: p66. ↩︎