shared secret
key
which will be used for further encrypting a big message. How is this possible ? n
, number of attackers waiting for the
transmission. DiffieHellman
method.
Steps  Akbar  Birbal  n Attackers 

1 
Decides a huge prime number P and a generator point G and shares it publically
over unsecure channel with Birbal .

Receive P and G from Akbar .

Intercepts the value of P and G from Akbar .

2 
Decides a Secret key a .

Decides a Secret key b .

Waiting for transmission. 
3 
Compute S_{a} Which is S_{a} = G ^{a} mod P 
Compute S_{b} Which is S_{b} = G ^{b} mod P 
Waiting for transmission. 
4 
Transmit S_{a} over unsecure
channel.

Transmit S_{b} over unsecure channel

Intercepts the value of S_{a} and S_{b} .

5 
Compute Secret S Which is S = S_{b} ^{a } mod P which is equivalent to
S = (G ^{b} mod P ) ^{a } mod P which is further equivalent to
S = G ^{ba} mod P

Compute Secret S Which is S = S_{a} ^{b } mod P which is equivalent to
S = (G ^{a} mod P ) ^{b } mod P which is further equivalent to
S = G ^{ab} mod P

Trying to evaluate a and b from S_{a} and
S_{b} respectively which is next to impossible.

6  Secret shared successfully ready for communication over a unsecure channel.  Secret shared successfully ready for communication over a unsecure channel.   
Steps  Akbar  Birbal  n Attackers 

1 
Let's assume prime number P = 29 and a generator point G = 7 and shares it publically
over unsecure channel with Birbal .

Receive P = 29 and G = 7 from Akbar .

Intercepts the value of P = 29 and G = 7 from Akbar .

2 
Decides a Secret key a = 3 .

Decides a Secret key b = 5 .

Waiting for transmission. 
3 
Compute S_{a} Which is S_{a} = G ^{a} mod P S_{a} = 7 ^{3} mod 29 S_{a} = 343 mod 29 S_{a} = 24 
Compute S_{b} Which is S_{b} = G ^{b} mod P S_{b} = 7 ^{5} mod 29 S_{b} = 16807 mod 29 S_{b} = 16 
Waiting for transmission. 
4 
Transmit S_{a}= 24 over unsecure
channel.

Transmit S_{b} = 16 over unsecure channel

Intercepts the value of S_{a}=24 and S_{b}=16 .

5 
Compute Secret S Which is S = S_{b} ^{a } mod P S = 16 ^{3 } mod 29 S = 4096 mod 29 S = 7 
Compute Secret S Which is S = S_{a} ^{b } mod P S = 24 ^{5 } mod 29 S = 7962624 mod 29 S = 7 
Trying to evaluate a = ? and b = ? from S_{a} = 24 and
S_{b} = 16 respectively which is next to impossible.

6  Secret shared successfully ready for communication over a unsecure channel.  Secret shared successfully ready for communication over a unsecure channel.   