Understanding Classical Encryption
Encrypt and break a Caesar cipher by hand and explain why a small key space and letter patterns make classical ciphers unsafe.
A secret message on the whiteboard
During a staff training session at the Kothrud head office, Riya Menon, the intern, writes PHHW DW QLQH on the whiteboard and asks the room to read it. Nobody can, until she shows them that every letter has been moved three places along the alphabet: P is really M, H is really E, and the message is MEET AT NINE. This is a classical cipher, one of the methods people used to hide messages by hand for more than two thousand years before computers existed. Classical ciphers are far too weak to protect anything today, but they show every basic idea of encryption in a form you can work out with a pencil, and their failures explain why modern ciphers are built the way they are.
A cipher wheel does the Caesar shift for you. Notice that the whole secret is one small number, the amount the inner ring is turned.
The Caesar cipher, step by step
The trick Riya used is called the Caesar cipher, named after Julius Caesar, who is said to have used a shift of three in his letters. It is a shift cipher: every letter of the plaintext is replaced by the letter a fixed number of places further along the alphabet. When you run past Z you wrap around to the start, so with a shift of three, X becomes A, Y becomes B and Z becomes C. Spaces and punctuation are usually left alone, or simply removed.
The Caesar cipher has all the parts that every encryption method has, which is why it is worth learning. The algorithm, the fixed recipe, is "move each letter forward by the shift". The key is the shift itself, a number from 1 to 25. Encryption moves letters forward, and decryption moves them back by the same amount. Like a railway timetable that everyone can read while only the booking clerk knows your seat number, the recipe is no secret at all; the key is.
To encrypt, find the letter on the Plain row and write the one below it. To decrypt, go the other way. X, Y and Z wrap around to A, B and C.
The basic encryption process is the same for every cipher, from Caesar's to the one inside your phone. The sender and the receiver agree on a key in advance. The sender feeds the plaintext and the key into the algorithm and sends the ciphertext. The receiver feeds the ciphertext and the same key into the reverse of the algorithm and gets the plaintext back. Everything that follows in cryptography is about making each of those steps stronger.
Why a shift cipher falls in seconds
Here is the fatal weakness. The Caesar cipher has only 25 useful keys, because a shift of 0 or 26 leaves the message unchanged. Someone who intercepts a Caesar message does not need to know the key; they can simply try all 25 shifts and look for the one that produces readable words. Trying every possible key one by one is called a brute-force attack, and against 25 keys it takes a person with a pencil a few minutes and a computer far less than a second.
The set of all possible keys for a cipher is called its key space. The size of the key space is the first thing a defender looks at, because it sets how much work a brute-force attack needs. A bicycle lock with one dial of ten digits can be opened by trying ten numbers; nobody would trust it to protect a bike outside a busy station. A cipher with 25 keys is that bicycle lock.
Try it yourself in the cipher wheel below. First encrypt a message and watch how the alphabet strip moves with the shift. Then crack the intercepted note in the challenge, a message about Tulsi Health's backup disk, by trying shifts, and finally press "Try every key" to see how quickly all 25 possibilities can be listed.
Substitution ciphers: a scrambled alphabet
A natural fix is to stop shifting and instead scramble the alphabet completely. In a substitution cipher, each letter is replaced by another letter according to a mixed-up table: A might become Q, B might become W, C might become K, with no pattern at all. The key is the whole scrambled table. The number of possible tables is enormous: 26 choices for the first letter, 25 for the next, 24 for the one after, and so on, which multiplies out to a number 27 digits long. Trying every key by brute force is no longer practical, even for a fast computer.
Yet substitution ciphers were broken routinely for centuries, and the reason is that they hide letters but not patterns. In ordinary English, E is the most common letter, then T, A and O, while Q, X and Z are rare. A substitution cipher replaces every E with the same cipher letter every time, so whichever cipher letter appears most often probably stands for E. Short words help too: a one-letter word is almost always A or I, and a common three-letter word is probably THE. Counting how often each letter appears and matching it to the language is called frequency analysis, and scholars were describing it more than a thousand years ago.
E and T are far more common than Q and Z. A cipher that always swaps E for the same symbol leaves this pattern in place for anyone who counts.
You can watch the pattern survive in the lab below. The message is a long stock request from the Nashik Road store, shifted by five, with a letter count of the ciphertext. Look only at the ciphertext and its tallest bar, guess which plaintext letter that bar stands for and which shift it implies, then compare with the shift the lab used.
In that message the letter J appears 16 times, far more than any other. If J stands for E, the shift is five, and the whole message unlocks at once. A scrambled-alphabet substitution would take a little longer, because each letter has to be matched separately, but the same counting attack works one letter at a time.
What classical ciphers teach modern ones
The limitations of classical encryption are a checklist of what modern ciphers must get right. The key space must be so large that brute force is hopeless, not 25 keys but numbers with dozens of digits. The ciphertext must not leak patterns: the same plaintext letter, or the same block of data, should not keep producing the same output in a way that can be counted. And the design should stay strong even when everyone knows it, because the only secret that can be quickly replaced is the key.
Each weakness on the left became a design rule on the right.
Two problems from the classical world remain even with modern ciphers. Both sides still need the same key, so it has to reach the receiver safely without anyone copying it on the way. And a cipher on its own only hides content: a forger who changes ciphertext, or a stranger who sends a message claiming to be you, is not stopped by scrambling alone. Modern cryptography answers these with separate tools, but the questions are the same ones Caesar's messengers faced. Whenever you see a home-made scheme such as "we just shift the customer IDs" or "we swap letters around", treat it as a classical cipher: easy to read for anyone who counts.