Transposition Ciphers
Ciphers that scramble the order of characters without changing the characters themselves.
History & context
Transposition is the second big idea in classical cryptography (alongside substitution). Instead of changing letters, you rearrange them. This preserves letter counts (and often vowel ratio) so the ciphertext can look deceptively “language-like” while still being unreadable. Historically, transpositions were frequently combined with substitution to increase strength. In puzzles, pure transposition appears a lot because it’s visually confusing but conceptually simple.
How Transposition Ciphers works
At a high level: choose a rule that maps plaintext positions → ciphertext positions. Common rules are based on grids (columnar), zig-zags (rail fence), or permutations (fixed position swaps). Because letters are not replaced, monogram frequencies and IoC tend to stay close to English, but bigrams/trigrams get disrupted because neighbors are no longer neighbors.
Core rules
- Letters are preserved; only positions change.
- Monogram frequency looks “normal” (English-like) if the plaintext is English.
- Bigrams/trigrams are degraded (TH/HE/THE stop being dominant).
- Padding rules matter (X’s or nulls may be added).
- Some variants remove spaces before transposition.
Worked example
How to encode / decode
Step-by-step
- Choose a specific transposition scheme (rail fence / columnar / permutation).
- Normalize text (decide if you remove spaces/punctuation).
- Apply the position-reordering rule.
- If the scheme uses a grid, decide how to pad the final row (if needed).
- To decode, reverse the exact same rule (padding must match).
How to break a Transposition Ciphers
Breaking a transposition is about finding the rearrangement rule. Because the letters are correct but order is wrong, you often see: • vowel ratio looks normal, • letter frequency looks normal, • but common words don’t appear. Practical workflow: decide which transposition family it resembles (rail vs columnar), then brute small parameters (rails/width) and score outputs for English.
Practical checklist
- Confirm it’s likely transposition: English-like frequency + high IoC, but no readable brute shifts (Caesar/Affine).
- Try rail fence first with small rails (2–6) and score outputs.
- Try column widths (2–20) for simple grid transpositions; look for readable fragments.
- Use cribs: if you suspect 'THE' or 'FLAG{' etc., test placements that could create them.
- For keyed columnar: test short keywords, or use heuristic scoring if you have enough text.
What frequency looks like
Transposition keeps monogram frequency close to plaintext because it doesn’t change letters. So your frequency chart still has the typical English curve. The giveaway is that bigrams/trigrams that are normally dominant (TH, HE, THE, AND) are reduced because adjacency is destroyed.
- IoC is often close to English.
- Monogram frequency looks English-like (peaks exist).
- But common bigrams/trigrams are unusually weak or scrambled.
- Vowel ratio often looks normal compared to random data.
Mini example
Common mistakes
- Misclassifying as substitution just because frequency looks English-like.
- Ignoring padding (one missing/extra filler breaks decoding).
- Not normalizing the same way the encoder did (spaces removed vs kept).
- Assuming there is always a keyword; many transpositions are parameter-only (rails/width).
Variants
- Rail Fence (zig-zag).
- Columnar (keyed column order).
- Permutation (fixed shuffle).
- Double transposition (apply two columnars; much harder).
- Route ciphers (spiral/diagonal read patterns in a grid).
Practice
Practice by encoding a message with rail fence (rails 3–5) and with columnar (short keyword), then try to recover the parameters from ciphertext only.
Try these prompts
- Rail fence with rails=3: encode a sentence, then recover rails by brute force.
- Column width=7 grid transposition: recover the width by scoring outputs.
- Try a columnar keyword of length 5 and see how padding changes decoding.
- Take a ciphertext and decide substitution vs transposition using frequency + bigrams.