**Diffie-Hellman Key Exchange Algorithm**

**Introduction**

The Diffie Hellman algorithm widely known as Key exchange algorithm or key agreement algorithm developed by Whitefield Diffie and Martin Hellman in 1976. The purpose of the algorithm is to enable two users to securely exchange a key that can be used for subsequent encryption of messages. The algorithm itself is limited to the exchange of secret values.

**Diffie – Hellman Key Exchange Algorithm
steps:**

**Step-1:** Select q
(prime number) and α (α is primitive root of q)

**Step-2:** User A
Key Generation: select X_{A}, X_{A} < q

Calculate**
public key Y _{A}**, Y

_{A}= α

^{X}

_{A }mod q

YA Shared
with user B

**Step-3:** User B
Key Generation: select X_{B}, X_{B} < q

Calculate**
public key Y _{B}**, Y

_{B}= α

^{X}

_{B}mod q

YB shared
with user A

**Step-4:** Calculation
of **secret key by user A**: K = (Y_{B})^{X}_{A} mod q

**Step-5:** Calculation
of **secret key by user B**: K = (Y_{A})^{X}_{B} mod q

**Same Secret key generate both sides**

K = (Y_{B})
^{X}_{A} mod q

= (α^{X}_{B} mod q) ^{X}_{A
}mod q

= (α^{X}_{B})^{ X}_{A}
mod q

= (α^{X}_{A}) ^{X}_{B}
mod q

= (α^{X}_{A} mod q) ^{X}_{B}
mod q

= (Y_{A}) ^{X}_{B} mod q

= K

**Diffie – Hellman Key Exchange Algorithm
explain with example:**

** Step – 1:** Select q
(prime number) and α (α is primitive root of q)

**Example, **here q =
7, α = 17.

** Step – 2:** User A
Key Generation: Select X

_{A }< q,

calculate
**public key Y _{A}**

_{ }and shared with user B: Y

_{A}= α

^{X}

_{A}mod q

**Example, **Here X_{A}
= 6,

Calculate
Y_{A} = α^{X}_{A} mod q ⇒17^{6} mod 7 ⇒ 1

** Step – 3:** User B
Key Generation: Select X

_{B }< q,

calculate
**public key Y _{B}**

_{ }and shared with user A: Y

_{B}= α

^{X}

_{B}mod q

**Example, **Here X_{B}
= 4,

Calculate
Y_{B} = α^{X}_{B} mod q ⇒17^{4} mod 7 ⇒ 4

** **

** Step – 4:** Calculation
of

**secret key by user A**:

K = (Y_{B})^{
X}_{A} mod q

**Example, **Here Y_{B}
= 4, X_{A} = 6

Calculate
K = (Y_{B})^{ X}_{A} mod q ⇒4^{6}
mod 7 ⇒ 1

** Step – 5:** Calculation
of

**secret key by user B**:

K = (Y_{A})^{
X}_{B} mod q

**Example, **Here Y_{A}
= 1, X_{B} = 4

Calculate
K = (Y_{A})^{ X}_{B} mod q ⇒1^{4}
mod 7 ⇒ 1

** **

**Solution of exercise (Given in video)**

**To learn more about Diffie-Hellman Key Exchange Algorithm, Click here**

**To learn more about How to find primitive roots, Click here**

**Watch more videos click here.**

## No comments:

## Post a Comment