0% found this document useful (0 votes)
9 views18 pages

Diffie-Hellman Key Exchange

The Diffie-Hellman Key Exchange Algorithm allows two parties to generate a shared symmetric cryptographic key without transferring it over an insecure channel. The process involves agreeing on two large prime numbers and each party independently calculating a public component to share, which is then used to compute the secret key. Several examples illustrate the algorithm's application with different values for primes and random integers.

Uploaded by

siddhiwade12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views18 pages

Diffie-Hellman Key Exchange

The Diffie-Hellman Key Exchange Algorithm allows two parties to generate a shared symmetric cryptographic key without transferring it over an insecure channel. The process involves agreeing on two large prime numbers and each party independently calculating a public component to share, which is then used to compute the secret key. Several examples illustrate the algorithm's application with different values for primes and random integers.

Uploaded by

siddhiwade12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Diffie-Hellman key

Exchange/agreement Algorithm
Introduction

• The Diffie Hellman Key Exchange Algorithm was developed by


Whitefeild Diffie and Martin Hellman.
• It is used to generate symmetric cryptographic key at sender as well
as receiver end so that there is no need to transfer key from sender
to receiver.
• If sender and receiver wants to communicate with each other they
first need to agree on the same key generated by Diffie Hellman
Algorithm , later on they can use encryption or decryption
Algorithm
• Firstly Alice and Bob agree on two large prime numbers n and g. these two
integers need not be kept secret. Alice and bob can use an insecure channel
to agree on them.
• Alice choose another large random number x, and calculate A such that:
A=gx mod n
• Alice sends the number A to Bob
• Bob independently chooses another large random integer y and calculate B
such that: B=gy mod n
• Bob sends the number B to Alice
• A now computes the secrete key k1 as follows: k1=Bx mod n
• B now computes the secrete key K2=Ay mod n
Example

• If p=23,g=5,A=4,B=3. solve using Diffie Hellman Algorithm


Example 2 :P=7, g=17, a=6, b=6
• Theory
• Start with algorithm
• Solution:
• Step1: calculate XA (public component of A)
• XA = ga mod p
• XA =17 6 mod 7
• =1
Step2: calculate XB (public component of B)
XB = gb mod p
XB =17 4 mod 7
=4
Step3:calculate Alice secrete key
Ak=(XB)a mod p
=(4)6 mod 7
=1
Step 4 :calculate Bob’s secrete key
B k=(XA)b mod p
=(1)6 mod 7
=1
Step 5:
Example 3: p=353, g=3, a=97, b=233
Example 4 p=11, g=2, a=9, b=3
Example 5: p=131,g=2, a=24, b=17

You might also like