Why is Diffe-Hellman Key Exchange secure?

Let’s analyze security from different perspectives:

What Does an Outsider See?

  • Observes g,A,B,pg, A, B, p, but doesn’t know a,ba, b

  • Since an outsider only knows A=gaA = g^a and B=gbB = g^b, to derive the shared secret S=gab mod pS = g^{ab}\ mod\ p requires either aa or bb. Unfortunately, from Discrete Logarithm Problem (link to previous chapter), it is very hard to obtain aa from A=ga mod pA = g^a\ mod\ p. The same hardness applies when we try to obtain bb from B=gb mod pB = g^b\ mod\ p

Can Alice Learn Bob’s Private Value?

Alice knows a,A,B,Sa, A, B, S, let's explore why she cannot derive bb which is Bob's private value on her own.

  • If she tries to derive bb either from B=gb mod pB = g^b\ mod\ p, this is basically Discrete Logarithm Problem (Link to previous chapter) which is again very hard.
Open Ended

What if she tries to derive b from A=ga mod pA = g^a\ mod\ p and S=gab mod pS = g^{ab}\ mod\ p, is that easy to do? If not, explain why.

Can Bob Learn Alice’s Private Value?

Similarly, Bob knows a,A,B,Sa, A, B, S but again cannot derive aa either from A=ga mod pA = g^a\ mod\ p or from B=gb mod pB = g^b\ mod\ p and S=gab mod pS = g^{ab}\ mod\ p due to Discrete Logarithm Problem.

Open Ended

We already see from above that it's hard to derive aa or bb through equation, however, wouldn't it be possible for the outsider or Alice and Bob to just guess the private value and brute-force to see if it fits.