Columnar Transposition

Write a message as a long column and then swap around the columns. Read the message going down the columns. A simple cipher, but one that is featured on the Kryptos sculpture at the CIA headquarters.

A columnar transposition, also known as a row-column transpose, is a very simple cipher to perform by hand. First, you write your message out across a set of columns. Then, you just rearrange the columns. For example, I have the message, “Which wristwatches are Swiss wristwatches.” You convert everything to upper case and write it without spaces. When you write it down, make sure to put it into columns and number them. Let’s use five columns.

 UnencodedRearranged
Column #: 4 2 5 3 1
W H I C H
W R I S T
W A T C H
E S A R E
S W I S S
W R I S T
W A T C H
E S
1 2 3 4 5
H H C W I
T R S W I
H A C W T
E S R E A
S W S S I
T R S W I
H A C W T
  S   E

Now, you just read the columns down in the order that you number them. Above, you will see the key is 4 2 5 3 1, which means you write down the last column first, then the second, then the fourth, the first, and finally the middle. When you are all done, you will get “HTHESTHHRASWRASCSCRSSCWWWESWWEIITAIIT”.

By default, spacing is preserved with this implementation, so I would suggest you remove spaces so people don’t know the word lengths in your message. If you decide to move the spaces with the text, then watch out for spaces at the beginning and end, and for double spaces within the encoded message, all of which can make codes very difficult to decode properly.

The column key can be a list of numbers or an alphabetic keyword/keyphrase.

Examples:

  • - There are garbage characters at the end to make a complete row.