🔐
PrimeDojo
Multiply two primes: easy. Un-multiply them: nearly impossible. That gap keeps your bank safe.
🔮 Open the crypto console →How maths becomes a lock
- Clock. Numbers wrap around at some size; that keeps huge powers small.
- Power. Raise a message to a public exponent (by squaring) — that is encrypting.
- Inverse. The private key is the number that undoes it — easy to find if you know φ(n).
- Break. An attacker who can factor n rebuilds φ, and then your private key. So keep n unfactorable.
The pieces of RSA
- The modulus n = p·q — the product of two secret primes. Public. Its two factors are the whole secret.
- Euler’s φ(n) = (p−1)(q−1) — the size of the clock the keys live on. You can only compute it if you know p and q.
- The public exponent e — any number coprime to φ. Encrypting is raising the message to e.
- The private exponent d = e⁻¹ mod φ — the modular inverse of e. It undoes encryption. An attacker gets it only by factoring n.