HomeForumRiddle ToolsWallpapers Links
Columnar Transposition Cipher
 
A columnar transposition cipher, also known as a row-column transpose cipher, is a very easy cipher to perform by hand. The message is written out in rows of a fixed length creating columns, these columns are then rearranged and the message read out again column by column. Both the length of the rows and the subsequent arrangement of the columns are defined by either a keyword or numerical key. In a regular columnar transposition cipher, any spare spaces are filled with nulls; in an irregular columnar transposition cipher, the spaces are left blank. Finally, the message is read off in columns, in the order specified by the key.

Example 1
  Unencoded Rearranged
Column #: 4 2 5 3 1
A C U P O
F P R O P
E R C O F
F E E I N
A C O P P
E R C O F
F E E C U
P T K Q V
1 2 3 4 5
O C P A U
P P O F R
F R O E C
N E I F E
P C P A O
F R O E C
U E C F E
V T Q P K

  Example 1: - Regular with Numerical Key
I have used the tongue twister, "A cup of proper coffee in a copper coffee cup" with a five column key of 4 2 5 3 1. Write out the message without spaces making sure to put it into columns, number each one and fill the empty spaces with random letters, I used TKQV.
To encrypt the message, read the columns down in the order that you numbered them. Write down the last column first, then the second, then the fourth, the first, and finally the last., this will give "OPFNPFUV CPRECRET POOIPOCQ AFEFAEFP URCEOCEK". I can put the example's information into the encoder for you: Encode or Decode
 
Example 2
  Unencoded Rearranged
Column #: H E L P U S
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
E H L P S U
E W A R D E
S I C O E V
E R D F E L
A E T O C N
  E
  Example 2: - Irregular with Keyword
In this example I have taken the phrase often used on Wikipedia "We are discovered flee at once" with a six letter keyword, HELP US.
To encrypt, the keyword's letters are placed in alphabetical order; EHLPSU then the method is exactly the same as the numerical example shown above, giving the encoded message "ESEA WIREE ACDT ROFO DEEC EVLN". The only difference is that in the encoder below keywords do not have to spaced like numeric keys. I have put the information into the encoder for you: Encode or Decode

To decipher a columnar transposition cipher, the recipient must to work out the column lengths by dividing the message length by the key length. The message can then be written out in columns again and the columns re-ordered by reforming the key word.

This columnar transposition cipher implementation will also move spaces around, so you can take "a b c" with a key of "2 1" and get "  abc" (note the two spaces in front). I suggest you remove all spaces before you encode the text, but they should be preserved even if you don't. New lines are ignored and not taken into consideration.

Columnar transposition continued to be used for serious purposes, as a component of more complex ciphers, at least into the 1950's. This cipher is actually used in the Kryptos sculpture, at the CIA headquarters in Virginia, in what is generally known as K3 (the third section of the sculpture), but this encoder will not give you the answer directly. You still need to do work to see the decoded message.



Columnar Transposition


:
The resulting columnar key:

Your message

This is your encoded or decoded text:

Source code courtesy of Tyler Akins

 
Double Columnar Tansposition Cipher