Columnar Transposition Cipher
Write in rows, read columns by keyword alphabetical order — keyword permutation cipher.
How to Use the Columnar Transposition Tool
- Enter a keyword — type any word and click Apply (e.g., ZEBRA, SECRET, KEY).
- Choose Encrypt or Decrypt — select the direction.
- Enter your text — spaces and punctuation are removed automatically.
- View the result — ciphertext appears on the right.
- Step-by-Step — click to see the columnar grid with column reading order highlighted.
About Columnar Transposition
Columnar transposition is one of the most widely used historical transposition ciphers. The plaintext is written left-to-right in rows under a keyword. The keyword letters are numbered in alphabetical order, and the columns are then read out in that numerical order to produce the ciphertext. For example, with keyword ZEBRA (Z=5, E=1, B=2, R=3, A=4), the columns are read in the order E, B, R, A, Z — that is, column 2 first, then 3, then 4, then 5, then 1.
The Encryption Algorithm
Step 1: Write out the plaintext (stripped of spaces and punctuation) in rows, with as many columns as the keyword length. If the last row is incomplete, pad with X. Step 2: Number each column by the alphabetical position of the keyword letter above it. Step 3: Read each column from top to bottom, in the order determined by the column numbers (1, 2, 3...). Concatenate these column readings to form the ciphertext.
Decryption Algorithm
Decryption reverses the process. Given the ciphertext and keyword: calculate the number of rows and which columns are shorter (if the last row is incomplete). Place the ciphertext characters back into columns in the same order used for encryption. Finally, read the grid row by row to recover the plaintext. This tool handles all padding automatically.
Historical Significance
Columnar transposition was used by many military organizations throughout the 19th and 20th centuries. The Union Army used a variant during the American Civil War. The German Army used double columnar transposition in WWI — applying the cipher twice with two different keywords — making it one of the most secure field ciphers of that era. The ADFGVX cipher combined a Polybius square substitution with a single columnar transposition. Various navies and intelligence services used columnar transposition through WWII, often combined with substitution. The cipher was eventually replaced by machine ciphers (like Enigma) and later by electronic encryption systems.
Double Transposition
Single columnar transposition can be broken by experienced cryptanalysts using column anagramming — trying different column orderings until readable text emerges. Double transposition (applying the cipher twice with different keys) is significantly stronger: the second transposition shuffles the column groups from the first transposition, creating a much more complex permutation that resists anagramming attacks. Double transposition was considered highly secure for manual cipher work and was used for the most sensitive communications in the field.