Tools / Rail Fence Cipher
Rail Fence Cipher Decoder
The rail fence is a transposition cipher: write your plaintext in a zigzag across N rails, then read off each rail row by row. The key is just the number of rails (and an optional starting offset). Pick brute-force decode to scan rail counts 2-10 against every offset.
Output
Output appears here.How to recognize a rail fence
Rail fence preserves the multiset of letters -the ciphertext has the same letter frequencies as the plaintext, just rearranged. If your ciphertext has English-looking letter distribution but no readable words, it’s a transposition cipher.
For other transposition variants try the Cipher Identifier first. For substitution-based ciphers, see the Frequency Analysis and Vigenere tools.
Challenges that use this tool
- rail-fencepicoCTF 2022 · Cryptography · Medium
- transposition-trialpicoCTF 2022 · Cryptography · Medium
Challenges where it helps
Guides that use this tool
- Reversing Custom Ciphers for CTF: Breaking Homebrew EncryptionBreak homebrew CTF encryption with a three-probe chosen-plaintext test: classify the cipher as byte-independent, arithmetic, or stateful, then invert it.
- Classical Ciphers for CTF: Caesar, Vigenère, and SubstitutionClassical ciphers for CTF: the four tells that name a Caesar, Vigenere, or substitution cipher on sight, so you can stop guessing and break it in one click.
Tools that pair with this one
- Cipher Identifier & Auto-DecoderPaste any ciphertext and the tool auto-runs every common decoder (base64, hex, Morse, ROT, Atbash, Bacon, binary, decimal, URL) and ranks the results by English-likeness.
- Atbash CipherEncode or decode the Atbash mirror cipher (A↔Z) in one click. Self-inverse, no key required.
- ROT / Caesar CipherDecode Caesar-shifted and ROT-encoded text. Drag the shift slider or scan all 26 rotations at once.
- Bacon CipherDecode Baconian A/B ciphers, including hidden-bit case and vowel encodings where each letter carries one bit.
Or browse all 40 CTF tools.