🔐

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

Public-key cryptography — the thing that lets you send a card number to a shop you have never met — rests on one lopsided fact: multiplying two big primes is fast, but factoring their product back is effectively impossible. Everything else is clock (modular) arithmetic: numbers that wrap around, raised to powers, undone with a modular inverse. PrimeDojo builds the whole of RSA from those pieces — small enough to do by hand, real enough to break.

  1. Clock. Numbers wrap around at some size; that keeps huge powers small.
  2. Power. Raise a message to a public exponent (by squaring) — that is encrypting.
  3. Inverse. The private key is the number that undoes it — easy to find if you know φ(n).
  4. Break. An attacker who can factor n rebuilds φ, and then your private key. So keep n unfactorable.

Everything runs on your device with exact integer arithmetic — no library, no network.

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.

A text-forward console (ages 15–18) — no cast art here by design.