← ACARA Digital Technologies Years 9–10

Monoalphabetic substitution cipher

A cipher that swaps each letter for a different letter from one scrambled alphabet. That scrambled alphabet is the key, and it never changes during the message.

Understanding Monoalphabetic substitution cipher in ACARA Digital Technologies Years 9–10

What it does: CYBER comes first in the key. The other letters follow in alphabetical order, skipping those already used, so the key is easy to remember but still scrambled. Decrypting reads the table backwards. The ciphertext letter Q is found in the key row and swapped for the plain letter A above it. The scrambled alphabet is the key. A single shift number is the key for a Caesar cipher, which is just one special kind of substitution. A becomes Q, B becomes W and C becomes E. So C, A, B becomes E, Q, W. A keyword alphabet starts with the keyword, then adds the unused letters in order. Every letter appears exactly once.

Common mistakes: Two plain letters map to the same cipher letter, 'x'. A substitution key is a scrambled alphabet, so each letter must be used once. Otherwise decryption is ambiguous. It should be {'a': 'x', 'b': 'q'}. The reverse table is looked up by letter, such as back['x'], so it must be a dictionary. A list can only be indexed by numbers. It should be back = {}.

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 828–859) and word search (Modules 810–859).

Take this worksheet further — free with Cloodit

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

Learning
Duo
In a monoalphabetic substitution cipher, what is the key?
A single number to shift byA scrambled alphabet
Matches
key: QWERTYUIOPASDFGHJKLZXCVBNN
↓
The key repeats the letter N and leaves out M. A valid key must use each of the 26 letters exactly once.
Applying
Meanings
Term
monoalphabetic substitution cipher
Meaning
A cipher that swaps each letter for a different letter from one scrambled alphabet. That scrambled alphabet is the key, and it never changes during the message.
Practice
plain = "abcdefghijklmnopqrstuvwxyz"
Testing
Gaps
print((key))
Check Answer
Spots
1key = {'a': 'x', 'b': 'x'}
2text = 'ab'

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

The 'Parrotfish' badge — Function Builder, 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. In a monoalphabetic substitution cipher, what is the key?
A. A scrambled alphabet ✓
B. A single number to shift by
The scrambled alphabet is the key. A single shift number is the key for a Caesar cipher, which is just one special kind of substitution.
2. Plain row: ABC... Key row: QWE... Using this key table, what does CAB encrypt to?
A. EQW ✓
B. QWE
A becomes Q, B becomes W and C becomes E. So C, A, B becomes E, Q, W.
3. How do you decrypt with a key table?
A. Look up each cipher letter in the plain row and read the scrambled letter below it
B. Find each cipher letter in the scrambled row and read the plain letter above it ✓
Decrypting uses the reverse table. You start from the scrambled row and go back to the plain row.
4. Which is a valid keyword alphabet made from the keyword ZEBRA?
A. ZEBRACDFGHIJKLMNOPQSTUVWXY ✓
B. ZEBRAZEBRACDFGHIJKLMNOPQST
A keyword alphabet starts with the keyword, then adds the unused letters in order. Every letter appears exactly once.
5. How many different keys can a substitution cipher have?
A. Only 26
B. 26 factorial, about 4 x 10^26 ✓
The first letter has 26 choices, the next has 25, and so on. That gives 26 x 25 x 24 x ... x 1 = 26!.

Match the Pairs

plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ key: QWERTYUIOPASDFGHJKLZXCVBNM → A substitution key table: the top row is the normal alphabet and the bottom row is the scrambled alphabet. A becomes Q, B becomes W, C becomes E.
26! = 403291461126605635584000000 → The number of possible keys in a substitution cipher, because there are 26 choices for the first letter, 25 for the next, and so on.
A keyword alphabet starts the scrambled alphabet with a keyword (repeated letters removed), then adds the remaining letters in order. → keyword: CYBER key: CYBERADFGHIJKLMNOPQSTUVWXZ
To decrypt, use the reverse table: find each ciphertext letter in the key row and swap it for the plain letter above it. → key: QWERTYUIOPASDFGHJKLZXCVBNM plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Q -> A
key: QWERTYUIOPASDFGHJKLZXCVBNN → The key repeats the letter N and leaves out M. A valid key must use each of the 26 letters exactly once.
Encrypt HELLO with key shift 3 -> KHOOR, so the key changes for every letter. → A monoalphabetic cipher uses one fixed scrambled alphabet for the whole message. The key does not change from letter to letter.

Key Term

monoalphabetic substitution cipher
A cipher that swaps each letter for a different letter from one scrambled alphabet. That scrambled alphabet is the key, and it never changes during the message.

Fill in the Blanks

1. plain = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" key = "QWERTYUIOPASDFGHJKLZXCVBNM" print(len(key))
Hint: Type the built-in function that counts the characters in the key. A valid key uses all 26 letters.
2. i = plain.index("H") cipher = key[i] print(cipher)
Hint: Type the variable holding the plain letter's position. Use it to look up the matching letter in the key table.
3. i = key.index("Z") print(plain[i])
Hint: Type the name of the scrambled alphabet that you search when decrypting with the reverse table.
4. import math print(math.factorial(26))
Hint: Type the math function that works out how many ways 26 letters can be arranged, which is the number of possible keys.
5. keyword = "ZEBRA" rest = "CDFGHIJKLMNOPQSTUVWXY" key = keyword + rest
Hint: Type the operator that joins the keyword and the leftover letters into one scrambled alphabet.

Spot the Error

Question 1
A key = {'a': 'x', 'b': 'x'}
B text = 'ab'
C for ch in text:
D print(key[ch])
Line A — Two plain letters map to the same cipher letter, 'x'. A substitution key is a scrambled alphabet, so each letter must be used once. Otherwise decryption is ambiguous. It should be {'a': 'x', 'b': 'q'}.
Question 2
A key = {'a': 'x', 'b': 'q'}
B back = []
C for p in key:
D back[key[p]] = p
Line B — The reverse table is looked up by letter, such as back['x'], so it must be a dictionary. A list can only be indexed by numbers. It should be back = {}.
Question 3
A FIRST letter has 2 choices
B SECOND letter has 25 choices
C THIRD letter has 24 choices
D KEYS = 26 x 25 x 24 x ... x 1
Line A — The first letter of the scrambled alphabet can be any of the 26 letters, not 2. The choices then go 26, 25, 24 and so on, which gives 26 factorial keys.
Question 4
A SET keyword TO ZEBRAS
B KEEP repeated letters in it
C ADD unused letters A to Z
D SET key TO the new alphabet
Line B — A keyword alphabet must use each letter once. Repeated letters must be removed, or the key is not a valid scrambled alphabet. It should say REMOVE repeated letters.
Question 5
A key = {'a': 'x', 'b': 'q'}
B out = ''
C for ch in key:
D out = out + key[ch]
E print(out)
Line C — The loop must go through each letter of the message, 'abba', so every letter can be swapped using the key table. Looping over the key does not encrypt the message. It should be for ch in 'abba':.

Student with a class code? Join your class →