Cipher Table

Columnar transposition cipher

Write the message in rows beneath a keyword, then read it off column by column in the keyword's alphabetical order. Simple to do, and for centuries a serious cipher.

Key

How columnar transposition works

Write the keyword as column headings. Write the message underneath, row by row. Then read the columns from top to bottom, taking them in the alphabetical order of the keyword letters.

With the keyword ZEBRAS and the message WE ARE DISCOVERED FLEE AT ONCE (spaces removed):

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

Column 1 (under A) reads EVLN. Column 2 (under B) reads ACDT. Carrying on through 3, 4, 5 and 6 gives EVLN ACDT ESEA ROFO DEEC WIREE.

To decrypt, the receiver works out how long each column must be from the message length and the key length, writes the ciphertext back into the columns in key order, and reads across the rows.

How to break it

As with any transposition, the letter frequencies are untouched, so the cipher announces its type straight away.

The real work is finding the column order. A keyword of n letters allows n × (n − 1) × … × 1 orders: 24 for four letters, 720 for six, about 40,000 for eight. Small keys can simply be exhausted. For larger ones, the analyst guesses the number of columns, writes the text out, and shuffles columns to bring together letter pairs that are common in English.

History

Columnar transposition was in military and diplomatic use from the seventeenth century until the middle of the twentieth. In the First World War, Germany’s ÜBCHI system was a double columnar transposition, which French cryptanalysts learned to read. The German ADFGVX cipher of 1918 paired a Polybius square with a columnar transposition; it was broken by Georges Painvin in time to give warning of a major offensive.

Questions people ask

How does the keyword decide the order?

Number the keyword's letters alphabetically. For ZEBRA, A is 1, B is 2, E is 3, R is 4, Z is 5. The column under A is read first, then the one under B, and so on. If a letter repeats, the leftmost copy goes first.

What if the message doesn't fill the last row?

Then some columns are one letter shorter than others. This page leaves the gaps empty ("irregular" transposition), which is harder to break than padding the row with extra letters.

How is it broken without the key?

For short keys, by trying every possible column order; a six-letter key has only 720. For longer keys, analysts look for column pairings that produce common letter pairs such as TH and ER. The breaker here tests every order for keys of up to seven columns.

What is double transposition?

Applying columnar transposition twice, usually with two different keywords. It is far stronger than a single pass and was used by resistance groups and intelligence agents through the Second World War.