Encrypt a message by squaring it mod n = pq. Decrypting means taking a square root mod n — which needs the factors p and q. Its beauty is a proof: recovering the plaintext is provably as hard as factoring n, a guarantee RSA (dart 050) only conjectures. Its quirk: every ciphertext has four square roots, so you must add redundancy to know which is the message.
Public key n = pq. Encrypt: c = m² mod n. Decrypt (with p, q): take the square root of c mod p and mod q (easy when p, q ≡ 3 mod 4), then combine by the Chinese Remainder Theorem — giving four candidate roots, of which one is m. Below: encrypt a message and see all four roots on decrypt. live demo
“RSA is proven as hard as factoring” — RSA Rabin is; RSA only conjectures it. That proof is Rabin’s whole point. cited
Provable security and a built-in ambiguity, from one line: c = m² mod n. Rabin 1979
Encryption is one modular square; decryption is two roots plus CRT — all the RSA machinery, reused: