Breaking a Caesar cipher by trying every shift
Trying every possible key, such as all 25 Caesar shifts, until readable text appears. A cipher with so few keys is weak because an attacker can check them all quickly.
Understanding Breaking a Caesar cipher by trying every shift in ACARA Digital Technologies Years 7–8
What it does: The tiny number of keys is the weakness. Checking 25 shifts takes a computer almost no time. Printing each shift next to its decrypted text lets the attacker scan for the one that makes sense. A Caesar cipher only has 25 useful shifts (1 to 25). Shift 0 or 26 leaves the message unchanged. That is a very small number to check. This is called brute force. The attacker keeps trying shifts until one gives real words. Gibberish means the shift is wrong. The attacker moves on to shift 8, then 9, and so on. Spotting real words like 'MEET AT THE OVAL' shows the correct shift was found.
Common mistakes: range(1, 25) stops at 24, so shift 25 is never tested. To try every Caesar key the loop must be range(1, 26). This prints the original ciphertext every time, so the attacker never sees the decrypted attempt. It should print k and plain.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 674–695) and word search (Modules 635–695).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
brute forceFill in the Blanks
Spot the Error
Student with a class code? Join your class →