A columnar transposition cipher with a keyword: the letters stay the same, only their order changes. The text is written in rows under the key and read by columns in the alphabetical order of the key letters. Encrypt or decrypt a text, and the table shows the column numbers and the reading order.
Everything runs in your browser — the text goes nowhere
The link will contain the text (up to 500 characters) and settings — share it with care.
02
Diagram
columns by the key “zebras”
632415
ZEBRAS
WEARED
ISCOVE
RED
The numbers above the columns are the reading order. The highlighted column is read first.
03
How it works
Rows under the key
z e b r a s
The text without spaces is written in rows under the letters of the keyword, as many letters per row as the key has.
Column numbers
zebras → 6 3 2 4 1 5
Columns are numbered by the alphabetical order of the key letters: “a” first, “b” second. Repeated letters count left to right.
Read by columns
wearediscovered → evacdeserodewir
The ciphertext is the columns in number order. The letters are the same, only their order changes, so frequencies stay as in the language.
04
Frequently asked questions
The text without spaces is written in rows under the letters of a keyword, as many letters per row as the key has. The columns are then numbered by the alphabetical order of the key letters and written out top to bottom, first column first. With the key ZEBRAS, WEAREDISCOVERED becomes EVACDESERODEWIR. The letters are the same; only their order changes.
By the alphabetical order of the key letters. In ZEBRAS the earliest letter is A, so its column is first, then B second, E third, R fourth, S fifth and Z sixth. That gives the order 6 3 2 4 1 5. If a letter repeats in the key, equal letters are numbered left to right. The numbers are shown above the columns in the table.
Not necessarily. If the last row is incomplete, the short columns are written out without empty cells, and decoding is still unambiguous. Padding makes all columns the same length: the checkbox fills the row with x (х for Russian). It shows in the ciphertext, and when decoding you will have to remove the extra x at the end by hand.
Yes, the scytale is a special case of transposition. Its key is not a word but the number of faces of the rod, and the columns are read in plain left-to-right order. The rail fence cipher also reorders letters, but writes them in a zigzag. Transposition with a keyword is stronger: only someone who knows the key knows the column order.
Work out how many letters each column holds: the text length divided by the key length, with the remainder going to the first columns on the left. Lay the ciphertext into the columns in number order and read the table by rows. The “Decrypt” tab does this here: enter the same key and the table is rebuilt. Without the key, the cipher is attacked by trying key lengths and anagramming.
Applying the transposition twice — with the same key or two different ones. After the second pass, neighbouring letters of the original text end up far apart, and recovering the order by anagramming becomes much harder. Double transposition was used as a hand cipher by armies and intelligence services in both world wars. Here you can do it by encrypting the result once more.