= Solution
In <Diffie-Hellman key exchange>, Alice and Bob publicly agree on a cyclic group $G=\langle g\rangle$ in which the <discrete logarithm problem> is believed hard. Alice chooses a secret $a$ and sends $A=g^a$; Bob chooses a secret $b$ and sends $B=g^b$. They independently compute
$$
B^a=(g^b)^a=g^{ab}=(g^a)^b=A^b.
$$
Thus
$$
\boxed{K=g^{ab}}
$$
is their shared key. A passive eavesdropper sees $g,g^a,g^b$ but is believed unable to compute $g^{ab}$ efficiently; this is the computational Diffie--Hellman assumption. The basic protocol does not authenticate the participants and is therefore vulnerable to a man-in-the-middle attack unless the exchanged values are authenticated.
Back to article page