Public-key cryptography · 03 The maths

Public-key cryptography: the maths

Trapdoor one-way functions: multiplication and factoring, modular exponentiation and the discrete logarithm.

Public-key cryptography rests on trapdoor one-way functions: easy to compute in one direction, extremely hard to invert, unless you know a secret piece of information — the trapdoor — that makes inversion easy.

ProblemEasy directionHard directionUsed by
FactoringMultiplying two large primesRecovering the primes from the productRSA
Discrete logarithmComputing g^x mod pRecovering x from g^x mod pDiffie-Hellman, DSA signatures
Elliptic-curve discrete logarithmAdding a point to itself k timesRecovering k from the resultECDH, ECDSA, Ed25519

An example of one-wayness

Computing 7^3 mod 11 is immediate: 343 divided by 11 leaves remainder 2. But if you are only told that 7^x mod 11 = 2, finding x means trying values one by one. With small numbers it takes a moment; with numbers hundreds of digits long, no known method does it in reasonable time.

Continue with
04 Worked example

Public-key cryptography: worked example

A digital signature with small numbers, using the example RSA keys, to see how private and public keys work together.

↑