Diffie-Hellman key exchange uses powers to find a shared secret.
One has to choose a
generator base b for the power (usually 2, 3, or 5) and a safe prime number N to be
the modulus, the (mod N) part. Typically this is done using a program like openssl dhgen -text
16
which for instance tells me to use N=35963 and b=2 for 16 bits of
security (can be broken in much less than a second; real world uses 2048 bits).
A=, so you'll want to find .
Secretly compute:
Now tell you “friend” your final number
bA = .
Your friend publicly tells your their final number is
c=.
Secretly compute:
So that means your shared secret number is
cA = .