You are sitting in a café in Dhaka, paying Tk 5,000 to a friend through your mobile banking app. The café's Wi-Fi carries your phone's traffic, and it carries the traffic of the stranger at the next table, who has a laptop open and a program that records every packet in the air. He can record yours too. What he gets is a string of bytes that looks like pure noise, something like a3426b48c34b9bc2…. Yet the bank's server turns that noise back into "send Tk 5,000 to Rahim" in a fraction of a millisecond, and nobody else can. The thing that makes noise from your message, and your message from noise, is a cipher.
Ciphers are very old. The story starts with a Roman general who, as the historian Suetonius tells it, wrote his private letters by moving every letter three places along the alphabet. Every cipher after him exists because the one before it was broken, and the way each one was broken is exactly what the exam papers ask.
So we walk through the story in order. We build each cipher by hand, break it by hand, and see what its breaker's trick forced the next designer to invent. This lesson is the first half of the story, from Caesar to the one cipher that cannot be broken. The second half, the ciphers that really protect your phone today, DES and AES, is the next lesson.
By the end you will be able to encrypt and decrypt with the Caesar, affine, Vigenère, Playfair, rail fence and columnar ciphers and show every step. You will break a substitution cipher with letter counts, and a Vigenère cipher by finding its key length. You will say what separates encryption from encoding, steganography and hashing. And you will explain why the one-time pad is perfect, why nobody uses it, and what goes wrong when a key is used twice. Every worked example and count in this lesson was computed by a program.