Math Playground
Numbers

Cryptography

How prime numbers and modular arithmetic keep your messages secret.

Cryptography uses number theory to keep messages secret. Modular arithmetic, primes and one-way functions are the workhorses.

Key ideas

  • Multiplying two big primes — easy.
  • Factoring the product back — practically impossible.
  • That gap is what RSA encryption is built on.