0% found this document useful (0 votes)
40 views6 pages

Deffie Hellman Key Exchange Algorithm

Deffie Hellman Key exchange algorithm for students in simpler way. Deffie Hellman algorithm with example. Key exchange algorithm for symmetric key cryptography

Uploaded by

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

Deffie Hellman Key Exchange Algorithm

Deffie Hellman Key exchange algorithm for students in simpler way. Deffie Hellman algorithm with example. Key exchange algorithm for symmetric key cryptography

Uploaded by

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

Diffie Hellman algorithm

• Take any a prime number g and p such that p is primitive


root of g.

• Let A and B are two communicating parties.

• Take any integer number for calculation of diffie hellman


algorithm

• Calculate R1 for A using following formula


R1=gx mod p
• Calculate R2 for B using following formula
R2=gy mod p
g and p

A B

x y

R1=gx mod p R2=gy mod p

R2 R1

KEY= R2x mod p KEY= R1y mod p


Primitive root of prime number
• Given a prime number n, the task is to find its primitive
root under modulo n. Primitive root of a prime number n is
an integer r between[1, n-1] such that the values of
r^x(mod n) where x is in range[0, n-2] are different.
• Example 1:
• n=7, assume r =5
• Verify using r^x(mod n)
• 50 (mod 7)= 1 mod 7 = 1
• 51 (mod 7)= 5 mod 7 = 5
• 52 (mod 7)= 25 mod 7 =4
• 53 (mod 7)= 125 mod 7 =6
• 54 (mod 7)= 625 mod 7 =2
• 55 (mod 7)= 3125 mod 7 =3
Primitive root of prime number

• Let prime number is n=5 and assume r=3


• Verify using r^x(mod n) up to [0,n-2]
• 30 (mod 5)= 1 mod 5 = 1
• 31 (mod 5)= 3 mod 5 = 5
• 32 (mod 5)= 9 mod 5 =4
• 33 (mod 5)= 27 mod 5 =2
Working of Diffie Hellman algorithm

• Take a prime number g and its primitive root p


• Take any two integer x and y
• Calculate R1=gx mod p at sender side and
• R2=gy mod p
• let g=7 and p=5
• Let x=3 and y=2 then
• R1=[gx mod p] =[73 mod 5] =[343 mod 5]=R1=3
• R2=[gy mod p]=[72 mod 5]=[49 mod 5]=R2=4
A B

R2 R1

KEY= R2x mod p KEY= R1y mod p

• KEY at A = 43 mod 5 =64 mod 5= 4


• KEY at B = 32 mod 5 = 9 mod 5 = 4

You might also like