Pick a number g, a prime p, and a secret exponent x. Computing h = gˣ mod p — multiply g by itself x times, wrapping around p — is quick and easy, even for huge numbers.
Now go the other way. I hand you g, p and h, and ask: what was x? Suddenly there's no shortcut. The values of gˣ bounce around the range 0…p unpredictably, giving you no hint whether you're close. This is the discrete logarithm problem, and like factoring, it's a one-way function: trivial forward, believed brutally hard backward.
That asymmetry is a gift to cryptography. It lets two strangers agree on a shared secret over an open line — the famous Diffie–Hellman key exchange — and underpins elliptic-curve cryptography, which protects much of today's secure web.
Comments
Loading comments...