Break a Secret Code
β¨ One bar chart of letter counts hands you your friend's secret key without a single guess at the message.
π§° You need
- two strips of card to make a cipher wheel
- paper and pencil
- a passage of about 200 letters you have written yourself
- a calculator
- a friend to exchange messages with
π What you will see
The letter counts are strongly uneven, with a few tall bars and many near zero. Matching the tallest bar to E usually gives the correct shift on the first or second attempt. A short message gives a flatter, less reliable chart.
π§ͺ Do it
- Write the alphabet twice around two card strips so one can slide against the other to give a shift.
- Choose a secret shift between 1 and 25 and encrypt your 200-letter message with it.
- Swap encrypted messages with your friend without revealing either key.
- Tally how often each letter appears in the message you received, and convert the counts to percentages.
- Draw a bar chart of the percentages and identify the tallest bars.
- Assume the tallest bar is E, work out the shift that this implies, and decrypt the first line to test it.
- If the first line is nonsense, try the next tallest bar as E and test again.
π‘ Why it happens
A Caesar cipher shifts every letter by the same amount, so there are only 25 possible keys and the whole pattern of letter frequencies simply slides along. In English, E, T and A are the most common letters, appearing in roughly 12, 9 and 8 per cent of text, so the tallest bar in a long enough message is very likely to be E. Comparing a measured frequency chart with known language frequencies is called frequency analysis, and it is why a single fixed shift is hopeless for real secrecy. Modern encryption defeats it by making every occurrence of a letter encrypt differently, so the output frequencies come out nearly flat.
π Now try this
Encrypt a 30-letter message with the same method and test whether frequency analysis still finds the shift.
π€ Think about it
What kind of message would defeat frequency analysis even with a simple shift cipher?
π§ Ask the Acharya
βWhat kind of message would defeat frequency analysis even with a simple shift cipher?β β ask him and he will explain it from your own chapters.
More for Std 9β12
Measure Gravity With a String
Six lengths of string, a stopwatch and one graph hand you the strength of Earth's gravity to within a few per cent.
Try it βScience40 minHow Fast Does It Fizz
The kitchen scale reading falls in real time, and the steepness of that fall is the speed of the reaction.
Try it βScience30 minHeart Rate Recovery Curve
The shape of your own recovery curve says more about your fitness than the peak number ever could.
Try it β