← ACARA Digital Technologies Years 7–8

Why a Caesar cipher is weak compared with modern encryption

A cipher with few keys and letter patterns that show through, so a computer can break it fast. Modern encryption uses huge keys and complex steps. A Caesar cipher has only 25 keys.

Understanding Why a Caesar cipher is weak compared with modern encryption in ACARA Digital Technologies Years 7–8

What it does: The loop tries all 25 keys one after another, so a computer breaks a Caesar cipher almost instantly. Counting letters finds the most common one. A Caesar shift keeps this pattern, which gives the key away. Modern encryption uses very large keys, so trying every key would take far too long even for fast computers. A Caesar cipher is fun for learning, but real data needs modern encryption such as AES. The variable holds the small number of Caesar shifts, which is why the cipher is weak. The patterns remain, which is what makes the cipher easy to crack.

Common mistakes: A Caesar cipher has 25 keys, so a brute-force loop must try them all. range(1, 10) only tries 9 shifts and might miss the right one. It should be range(1, 26). A Caesar shift keeps the message length the same, so the lengths are equal. This leaked pattern helps attackers. The check should use == instead of >.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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 696–726) and word search (Modules 696–770).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How many useful keys does a Caesar cipher have?
25 shiftsTrillions of shifts
Matches
A Caesar cipher is strong because shifting hides every pattern
↓
A Caesar shift moves every letter the same amount, so letter patterns like common letters stay visible.
Applying
Meanings
Term
weak cipher
Meaning
A cipher with few keys and letter patterns that show through, so a computer can break it fast. Modern encryption uses huge keys and complex steps. A Caesar cipher has only 25 keys.
Practice
caesar_keys = 25
Testing
Gaps
caesarKeys ←
Check Answer
Spots
1msg = 'KHOOR'
2for shift in range(1, 10):

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Kangaroo Rat' badge — Speed Typer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How many useful keys does a Caesar cipher have?
A. 25 shifts ✓
B. Trillions of shifts
A Caesar cipher only shifts letters by 1 to 25 places, so there are just 25 keys to try.
2. Which is a reason a Caesar cipher is weak?
A. It uses a key that is far too long to guess
B. A computer can try all 25 keys in a blink ✓
With so few keys, a computer can test every shift almost instantly. Caesar keys are short, not huge.
3. Modern encryption keys compared with a Caesar key:
A. Modern keys are huge, with trillions of trillions of options ✓
B. Modern keys are about the same size, with 25 options
Modern encryption uses very large keys, so trying every key would take far too long even for fast computers.
4. In a Caesar cipher, what happens to the letter patterns of the message?
A. They disappear completely
B. They remain, so common letters like E still stand out ✓
Every E turns into the same new letter each time. The most common letter in the ciphertext often matches E, which gives the code away.
5. Which method helps a code breaker crack a Caesar cipher without knowing the key?
A. Looking for the most common letter in the ciphertext ✓
B. Guessing one password out of trillions
Because patterns remain, counting letters (frequency analysis) quickly reveals the shift.

Match the Pairs

keys = 25 → A Caesar cipher has only 25 possible keys, so there are very few shifts to try
keys = 2 ** 128 → Modern encryption can have trillions upon trillions of keys, far too many to try one by one
A computer can try every Caesar shift in a split second → for shift in range(1, 26):
Letter patterns remain in a Caesar cipher, so the most common letter in the ciphertext is probably E → most_common = max(counts, key=counts.get)
A Caesar cipher is strong because shifting hides every pattern → A Caesar shift moves every letter the same amount, so letter patterns like common letters stay visible.
A computer needs years to try all 25 Caesar keys → 25 keys is a tiny number, and a computer can try them all in a blink, not years.

Key Term

weak cipher
A cipher with few keys and letter patterns that show through, so a computer can break it fast. Modern encryption uses huge keys and complex steps. A Caesar cipher has only 25 keys.

Fill in the Blanks

1. caesarKeys ← 25
Hint: Type how many possible shift keys a Caesar cipher has, which is why it is easy to break.
2. FOR shift ← 1 TO 25 DECRYPT(ciphertext, shift)
Hint: Type the keyword that makes a computer repeat the try-a-key step for every shift.
3. keysTried ← 25 IF keysTried = 25 THEN DISPLAY "Every key tried"
Hint: Type the operator that checks whether two values are equal.
4. counts ← COUNTLETTERS(ciphertext) DISPLAY counts
Hint: Type the variable holding the scrambled message, because its letter patterns still show through.
5. modernKeys ← 2 ^ 256
Hint: Type the operator that raises a number to a power, giving a huge number of modern keys.

Spot the Error

Question 1
A msg = 'KHOOR'
B for shift in range(1, 10):
C guess = decrypt(msg, shift)
D print(shift, guess)
Line B — A Caesar cipher has 25 keys, so a brute-force loop must try them all. range(1, 10) only tries 9 shifts and might miss the right one. It should be range(1, 26).
Question 2
A msg = 'HELLO'
B cipher = caesar(msg, 3)
C print(len(cipher) > len(msg))
Line C — A Caesar shift keeps the message length the same, so the lengths are equal. This leaked pattern helps attackers. The check should use == instead of >.
Question 3
A cipher = 'KHOOR'
B count = 0
C for ch in cipher:
D if ch = 'R': count += 1
E print(count)
Line D — Counting letters shows how patterns remain in Caesar ciphertext. The comparison must use == to check equality. A single = is assignment and causes a syntax error.
Question 4
A cipher = 'KHOOR ZRUOG'
B top = least_common(cipher)
C shift = ord(top) - ord('E')
Line B — Frequency analysis looks for the MOST common letter, which probably stands for E in English. Using the least common letter would not reveal the shift. It should be most_common(cipher).
Question 5
A key_bits = 128
B keys = 2 ** key_bits
C rate = 10 ** 12
D years = keys / rate * 31536000
E print(years)
Line D — keys / rate gives the number of seconds. To turn seconds into years you divide by the seconds in a year, not multiply. The line should be keys / rate / 31536000.

Student with a class code? Join your class →