RSA gives everyone a padlock they can snap shut but only YOU can open. Multiply two big primes into a public number n; anyone can encrypt to you with n; but undoing it needs the two primes — and factoring a big n back into its primes is, so far, infeasible. Publish the lock, keep the key. It secured the internet for decades. Slide the message and watch it lock and unlock.
RSA (1977): pick primes p, q; n = pq and φ(n)=(p−1)(q−1). Choose public exponent e coprime to φ, and private d with e·d ≡ 1 (mod φ). Encrypt c = m^e mod n; decrypt m = c^d mod n (correct by Euler’s theorem). The public key (e,n) locks; the private d unlocks; and recovering d from the public key requires FACTORING n into p and q — believed hard for large n. Here p=61,q=53,n=3233,e=17,d=2753: m=65 → c=2790 → 65. A fail-loud self-check throws unless encrypt-then-decrypt recovers the message. ◆ real public-key cryptography, node-verified.
Security relies on factoring being hard (unproven; Shor’s quantum algorithm would break it), and textbook RSA shown here omits padding (real RSA needs OAEP to be safe). The modular-exponentiation correctness is exact.