Diffie hellman and the discrete algorithm problem Suppose Alice and Bob are exchanging keys using D

Wronsonia8g

Wronsonia8g

Answered question

2022-07-07

Diffie hellman and the discrete algorithm problem
Suppose Alice and Bob are exchanging keys using Diffie-Hellman Key-Exchange Algorithm.
a - Alice secret key
g - generator
p - prime
x - the public key passed from Alice to Bob.
Eve is listening to the communication and she is exposed to the three parameters g,p,x.
She's using a brute-force method to find a, Alice's secret key.
Thus, Eve is looking for a satisfying this equation:
g a mod p = x
Now, I know (By testing) Eve can find a a satisfying the equation above, and by using a she can also compute the common secret key used by Alice and Bob.
Why is it mathematically true?

Answer & Explanation

potamanixv

potamanixv

Beginner2022-07-08Added 15 answers

Let the secret number chosen by Bob be b. During exchange, Bob will send y = g b mod p to Alice.
The common secret key obtained after the protocol, k, is g a b mod p. If Eve has another a that satisfies g a mod p = g a mod p, then she can still perform what Alice would do after listening to y:
k = y a mod p = ( g b ) a mod p = ( g a ) b mod p = ( g a ) b mod p = k
Which is the same as what Alice and Bob would get.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?