Rail Fence & Columnar Transposition Encryption/Decryption
A transposition cipher is a method of encryption that rearranges the positions of characters in the plaintext without changing the characters themselves. Unlike substitution ciphers that replace characters, transposition ciphers shuffle them according to a systematic rule.
The Rail Fence cipher writes the message in a zigzag pattern across multiple "rails" (rows), then reads off each rail from top to bottom. It's one of the oldest transposition ciphers.
Plaintext: THEQUICKBROWNFOX
T U B N
H Q I K R W F X
E C O O
Ciphertext: TUBNHQIKRWFXECOO (read rails top to bottom)
Columnar transposition writes the message in rows of a fixed length (number of columns), then reads off the text column by column. With a keyword, columns are read in alphabetical order of the keyword letters.
Plaintext: THEQUICKBROWNFOX
T H E Q U I C K B R O W N F O X
Ciphertext: TIOXHCWEKNQBFURO (read columns left to right)
Keyword: ZEBRA (5 letters = 5 columns)
Columns read in alphabetical order: A=1, B=2, E=3, R=4, Z=5
Z E B R A 5 3 2 4 1 --------- T H E Q U I C K B R O W N F O X Read order: A→B→E→R→Z Ciphertext: URXOKEHCWNQBFTI
Rail Fence creates a zigzag pattern and is simpler but less secure. It creates a distinctive zigzag pattern. Columnar is more flexible - you can use a simple fixed column count or add a keyword for extra security. For educational purposes, try both to see how they differ!
Simple columnar reads columns left to right (1, 2, 3, 4...). Keyed columnar uses a keyword to determine reading order - columns are read in alphabetical order of the keyword letters. For example, with keyword "ZEBRA", you'd read columns in order: A, B, E, R, Z (positions 5, 3, 2, 4, 1).
In keyed columnar transposition, the keyword length automatically determines the number of columns. You cannot set them separately!
Solution: If you want exactly 3 columns, either:
Transposition ciphers may add padding characters (usually 'X') to fill incomplete rows or rails. These extra characters should be removed after decryption. Our tool automatically handles this for most cases.
You can type spaces and punctuation in your input, but the tool will automatically remove them and convert to uppercase before encryption. This is standard practice for classical transposition ciphers because:
Example: Input "HELLO WORLD" → Encrypted as "HELLOWORLD" → Output varies by cipher settings
No! Transposition ciphers alone are not secure for modern use. They can be broken by hand with enough text. This tool is for educational purposes and puzzle creation. For actual security, use modern encryption like AES-256 or RSA.
For rail fence, try different numbers of rails (2-10). For columnar, you need to know the column count or keyword. Try common column counts (5, 6, 8) or if it's keyed, you'll need the exact keyword. Check out our Columnar Transposition Analyzer tool that can automatically test different configurations!