How it works · Security

AI is about to break encryption, it's not too late to learn how it works

Two prime numbers make a lock. The leftover after division is what hides the message.

61 times 53 sits in a red ring marked 3233, on warm paper.

The headlines say a machine is about to read locked messages. One lock they name is RSA. It plays below. Back and Next stop it so you can look.

61 × 53 easy 3233
3233 hard 61 and 53

Multiply two primes and you get the lock number. Splitting it back apart is the hard part.

1 / 5

Try your own number. The primes are tiny and there is no filler. Do not type a password.

    Encrypt a sentence

    This makes two real primes, large enough for a sentence. Paste locked text into the box below and decrypt it with n and d. The lock is still the classroom one, with no filler. Do not type a secret.

    p
    q
    n
    e
    d

    Short version:

    • Everyone can see the lock number 3233 and the public power 17. The secret power is 2753. You do not send that one.
    • Locking keeps the leftover: c = m^e mod n. Opening uses the secret power. Signing uses the secret power first, and the public power checks it.
    • Breaking a real lock means splitting its number back into the two primes. 3233 is small on purpose.

    Why a real lock is harder

    3233 has four digits, so you can split it by trying what divides it. A real lock number has hundreds of digits. The computer stores it as 2048 ones and zeros.

    A quantum computer big enough to split that may still be years or decades away, NIST says. Someone can save today’s locked message and wait. NIST’s plain page calls that harvest now, decrypt later: collect now, open later. Shor’s method (1994) is how that computer would do the split. The new locks, published 13 August 2024, are ML-KEM and ML-DSA. NIST takes the old ones out of its rules by 2035. It does not name the year a real RSA lock breaks.

    Leave the browser padlock on

    I would leave the padlock in the browser on. The picture is the classroom version: tiny primes, no filler, secret power shown because that is the point. A real signature, the kind on the card a website shows your browser, adds filler first. The rulebook for that filler is PKCS#1. NIST is asking people to start using ML-KEM and ML-DSA, not to stop locking messages while they do.

    A password manager builds its key from your passphrase, slowly, on purpose. A card tap is a one-time code for one amount.

    Questions people ask

    Does the public power have to be 17? No. Any whole number from 3 up works, as long as it and the helper number (one less than each prime, multiplied) share no divisor bigger than 1. 17 is short enough to watch.

    Can I put a password in the form? No. The lock number is 3233, and the secret power is printed.

    Did a chatbot break a real RSA lock? The number in the picture has four digits, and both primes are on it. A real one has hundreds of digits. A headline that a model cracked RSA still has to show the two primes it split. These two are 61 and 53.

    Cheat sheet

    Cheat sheet. Everyone can see n and e. The secret is d. Locking and opening both keep the leftover after division.

    Further reading

    Written by Rafi Loom

    Backend engineer who builds high-volume systems that move money. More about Rafi