2 ms·
Yeah, I'm not sure why they used a blatantly broken example, but here: >>> The public key is like a math answer that is easy to compute if you have the whole
by a1369209993 3y ago
Yeah, I'm not sure why they used a blatantly broken example, but here:
>>>
The public key is like a math answer that is easy to compute if you have the whole equation, but really hard if you only have the answer.
Kind of like "if 2^x mod 32749 = 29640, what is x?"
You can figure it out, but it requires testing lots of numbers (a brute force apporoach) to figure out that it's 12345.
Say Adam sends the public key of 29640 to Bob. (Note that the public key was chosen to be two to some known power, modulo a shared and public prime number).
Bob chooses a new number - say 22222 - and computes 2^22222 mod 32749, too, and the sends it back to Adam.
Now we have 2^22222 mod 32749 => 12883.
When Adam gets that public key back, he can raise it to his own private key, 12345, and get (2^b)^a = 2^(b*a) (mod 32749) = 31458.
Meanwhile, Bob can do the computation (2^a)^b = 2^(a*b = b*a) (mod 32749) = 31458.
Even though Eve listened to both numbers being transmitted:
Adam: "29640"
Bob: "copy. 12883"
Only Adam and Bob can know the result 31458 without doing brute force exponentiation.
Brute force exponentiation is easy for prime numbers less than 33k, but a sender can choose a prime number that's long enough to satisfy their privacy needs, based on their estimate of Eve's resources.
So the bottom line is that the secret is easy to compute if you have one of the private keys, but incredibly time consuming (brute force) if you don't.
<<<
There are still some problems with this (really, Finite-Field Diffie-Hellman just generally kind of sucks, even without quantum attacks), but it's basically the right idea.