Prime Numbers: What They Are and Why Cryptography Loves Them

Prime numbers seem like a number theory curiosity. They're actually what keeps your bank password safe.

Google this topic and you will get a hundred answers, half of them wrong. Here is the version that holds up. Prime numbers seem like a number theory curiosity. They're actually what keeps your bank password safe.

Definition

Greater than 1, divisible only by 1 and itself. 2, 3, 5, 7, 11, 13, 17, 19...

Why 2 is the only even prime

Every other even number is divisible by 2.

Distribution

Primes thin out as numbers grow but never end. Prime counting function (π(n)) ≈ n/ln(n).

RSA cryptography

Multiplying two huge primes is easy. Factoring the product is computationally infeasible. That asymmetry secures HTTPS.

Pro tips

  • Sieve of Eratosthenes finds primes up to a limit quickly.
  • Mersenne primes (2^p − 1) are the largest known primes.

Frequently asked questions

Is 1 prime? No — by definition primes must be greater than 1. Convention rules out edge cases.

How many primes exist? Infinitely many — proven by Euclid 2,300 years ago.

Whatever number you land on, sanity-check it against a second method or a quick estimate in your head.

Related