Alice
Eve sees
Bob
g = 5, p = 23agreed in public
g = 5, p = 23
g = 5, p = 23agreed in public
a = 4secret
?
b = 3secret
54 mod 23 = 4sends A →
A = 4, B = 10
53 mod 23 = 10← sends B
104 mod 23 = 18shared secret
?
43 mod 23 = 18shared secret

publicsecretEve would need a or b: the discrete logarithm of 4 or 10.