Diffie -Hellman: Key Exchange and Public Key Cryptosystems Supervisor:- DR. Lutfi Khanbri Rania Nasser Abdualqader Alhafrah Reg.No : MITE02218 MIT
Introduction Diffie –Hellman key exchange is a mathematical method of securely exchanging cryptographic keys over a public channel and was one of the first public-key protocols as conceived by Ralph Merkle and named after that by Whitfield Diffie and Martin Hellman .
DH is one of the earliest practical examples of public key exchange implemented within the field of cryptography. Published in 1976 by Diffie and Hellman, this is the earliest publicly known work that proposed the idea of a private key and a corresponding public key.
History The primary researchers to find and publish the ideas of Public Key Cryptology were found by Whiteld Diffe and Martin Hellman from Stanford University, and Ralph Merkle from the University of California.
As so frequently happens in the experimental world, the two gatherings were working on the same issue - Diffie and Hellman on public key cryptography and Merkle on public key distribution - when they got to know about one another's work and acknowledged there was collaboration in their methodologies. In Hellman's words : "We each had a key piece of the puzzle keeping in mind it's actual one of us first said X, and another of us first said Y, and so on, it was the combination of forward and backward between us that permitted the disclosure.."
What is Diffie – Hellman? Is an algorithm to enable two users to securely exchange a key that can then be used for subsequent encryption of messages . The Diffie -Hellman algorithm depends for its effectiveness on the difficulty of computing discrete alogarithms .
The Diffie -Hellman Key Exchange Algorithm
Primitive Roots is a primitive root of if: mod , mod , mod ……………… mod are distinct and congruent to a power of .
Example 1: Is 2 a primitive of prime number 5? mod 5 mod 5 2 mod 5 mod 5 4 mod 5 mod 5 3 mod 5 mod 5 1 2 4 3 1 Yes, 2 is a primitive of prime number 5
Algorithm Example 1: Is 2 a primitive of prime number 7? mod 7 mod 7 2 mod 7 mod 7 4 mod 7 mod 7 1 mod 7 mod 7 1 mod 7 32 mod 7 4 mod 7 64 mod 7 1 2 4 1 1 32 mod 7 4 64 mod 7 1 No, 2 isn’t a primitive of prime number 7
Diffie -Hellman Correctness and its Proof 2. Bob has computed 3. Bob has
The process
Illustration with Examples
Example 1 Illustration with colors
Example2: The security of the Diffie -Hellman key exchange lies in the fact that, while it is relatively easy to calculate exponentials modulo a prime, it is very difficult to calculate discrete logarithms. For large primes, the latter task is considered infeasible. Here is an example. Key exchange is based on the use of the prime number.
Step 1 : Alice and Bob get public numbers P = 7, G = 3 Step 2 : Alice selected a private key a = 4 and Bob selected a private key b = 5 Step 3 : Alice and Bob compute public values Alice : x =(3^4 mod 7) = (81 mod 7) = 4 Bob : y = (3^5 mod 7) = (243 mod 7) = 5 Step 4 : Alice and Bob exchange public numbers
Step 5 : Alice receives public key y =5and Bob receives public key x = 4 Step 6 : Alice and Bob compute symmetric keys Alice : ka = y^a mod p = 625 mod 7= 2 Bob : kb = x^b mod p = 1024 mod 7= 2 Step 7 : 2 is the shared secret.
Coding C#
Secrecy chart The chart below depicts who knows what, again with non-secret values in blue , and secret values in red . Here Eve is an eavesdropper – she watches what is sent between Alice and Bob, but she does not alter the contents of their communications.
Man-In-The-Middle Attacks
Advantages and Disadvantages
Its advantages are The security factors with respect to the fact that solving the discrete alogarithm is very challenging, and That the shared key (the secret) is never itself transmitted over the channel. Its disadvantages are There are expensive exponential operations involved, and the algorithm can’t be used to encrypt messages, it uses for establishing a secret key only.
There is also a lack of authentication. There is no identity of the parties involved in the exchange. It is easily susceptible to man-in-the-middle attacks. A third party C, can exchange keys with both A and B, and can listen to the communication between A and B. Its disadvantages (con.)
Future of Diffe -Hellman
Future of Diffe -Hellman Di ff e -Hellman is an public key algorithm, specialists say it don't scale well for future.As of right now it is expressed that Diffe - Hellman keys shorter than 900 bits are not suciently secure. To make Diffe - Hellman keys, which now can go to 1,024 bits, secure for the following 10 to 20 years, associations would need to grow to key lengths of no less than 2,048 bits, as per Stephen Kent, chief researcher at BBN Technologies.In the long run, key sizes would need to grow to 4,096 bits
Conclusion Designing a Key exchange algorithm with 100% Accuracy is not possible. Our Algorithm ideas makes execution simpler and in addition avoidance from common Attacks. Security change is useful in light of the fact that Diffie Hellman Algorithm is the premise of a few security standards and services.
References William Stallings - Cryptography and Network Security 5th edition. www.youtube.com . Implementation of Diffie-HellmanAlgorithm-GeeksforGeeks