Diffie-Hellman Key Exchange EXAMPLE

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Diffie-Hellman Key Exchange EXAMPLE

1- Alice and Bob will agree on prime number let’s say p = 11


and will choose a generator. Let’s say g = 2 < p
g is a primitive root of p

2- Alice choose random value α < p. Suppose α = 8, and she will compute the
public Key:
A= g α mod p
A= g α mod p = 2 8 mod 11 = 3

Alice will send A=3 to BOB

3- BOB choose random value b < p. Suppose b = 6, and he will compute the
public key:
B= g b mod p
B= g b mod p = 2 6 mod 11 = 9

BOB will send B=9 to Alice

4- Alice will compute the shared secret key based on B received from BOB
S= B α mod p = 9 8 mod 11 = 3

5- BOB will compute the shared secret key based on A received from Alice
S= A b mod p = 3 6 mod 11 = 3

We can notice that 3 is the secret key computed between BOB and Alice
without sharing it through the Network.

You might also like