How to use the columnar transposition tool
- Choose the Direction: Encrypt or Decrypt.
- Enter the Keyword. The default is ZEBRAS.
- Keep Remove spaces and punctuation first ticked for the classic style, or untick it to keep spaces as characters in the grid.
- Optionally type one character in Pad the last row with (encryption only).
- Type into Your text and copy the Result.
What it does and when to use it
Columnar transposition shuffles the order of letters without changing any of them. It was a standard hand cipher for armies and diplomats for a long time, often applied twice in a row (double transposition) for extra strength. Today it is a classroom favourite because you can follow it on squared paper, and a regular in puzzle hunts and capture-the-flag challenges.
It is for puzzles and learning only. The letter frequencies of the original language survive, which reveals at once that a transposition was used, and anagramming attacks break single transposition. Simpler relatives are the rail fence cipher, which uses a zig-zag instead of a keyword, and the scytale cipher, which reads columns in plain order. To scramble letters by substitution instead, try the keyword substitution cipher.
How it works
The keyword sets the column count and the reading order. ZEBRAS has six letters; in alphabetical order they are A, B, E, R, S, Z, so column 5 is read first, then 3, 2, 4, 6 and 1:
Z E B R A S
6 3 2 4 1 5
-----------
W E A R E D
I S C O V E
R E D F L E
E A T O N C
E
Reading the columns in that order gives EVLN + ACDT + ESEA + ROFO + DEEC + WIREE. Column 1 has five letters because the last row is short.
To decrypt, the tool works out the length of every column from the message length, cuts the ciphertext into those pieces in key order, places them back under the keyword and reads across the rows. It runs in your browser.
Worked examples
Results from the tool:
WE ARE DISCOVERED. FLEE AT ONCE ZEBRAS → EVLNACDTESEAROFODEECWIREE
same, pad X ZEBRAS → EVLNXACDTXESEAXROFOXDEECXWIREE
EVLNACDTESEAROFODEECWIREE ZEBRAS, Decrypt → WEAREDISCOVEREDFLEEATONCE
Meet at noon BALL → etnMaoento
With pad X, five X letters fill the short last row, and every column becomes five letters long. The last line shows that the case is kept and that the two L columns are read left to right.
Limits and tips
- Longer keywords with no repeated letters give more possible orders.
- Encrypting twice with two different keywords is far stronger than once, though still not secure.
- Word breaks disappear when spaces are removed, so the reader has to split the words again.
Frequently asked questions
What happens when the keyword has a repeated letter?
Should I pad the last row?
Can the keyword contain digits?
Why does decryption give nonsense?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.