Transposition cipher
A cipher that keeps the same letters but rearranges their order by a rule, like writing them in a zigzag on two rails and reading off the rows.
Understanding Transposition cipher in ACARA Digital Technologies Years 7–8
What it does: DFNEED uses exactly the same letters as DEFEND (D, E, F, E, N, D), only rearranged by the rail fence rule. The top row HLO is followed by the bottom row EL, which gives the ciphertext HLOEL. The letters C, A and T are all still there. Only their positions changed, so it is transposition. The first letter goes on the top rail, the second on the bottom, the third on top again, and so on. Reading the rows one after the other gives the ciphertext. Reading the zigzag order again would just give back the plaintext. With an odd number of letters, the top rail gets one extra. The top rail holds H, L, O and the bottom rail holds E, L.
Common mistakes: The bottom rail of a two-rail rail fence holds the letters at positions 1, 3, 5... so the slice must start at 1: text[1::2]. Starting at 2 skips a letter and repeats letters from the top rail. The ciphertext is made by reading off the top rail and then the bottom rail. The line should be cipher = top + bottom. Using top twice loses the bottom letters.
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.
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
transposition cipherFill in the Blanks
Spot the Error
Student with a class code? Join your class →