What Is Atbash & Rail Fence Cipher?
A free online tool combining two classical ciphers. Atbash is a monoalphabetic substitution cipher that reverses the alphabet (A becomes Z, B becomes Y, etc.), with an option to also reverse digits (0↔9). It is self-inverse — applying it twice returns the original. Rail Fence is a transposition cipher that writes letters diagonally across a configurable number of rails (2-10), then reads them row by row. Includes a rail pattern visualization showing exactly how each letter is placed on the fence. Both are fully bidirectional for encryption and decryption. All processing is done locally in your browser.
The Atbash cipher is one of the oldest known encryption methods, dating back to ancient Hebrew texts where it was used to conceal meaning. It works by reversing the alphabet: A becomes Z, B becomes Y, C becomes X, and so on. The Rail Fence cipher, by contrast, is a transposition cipher that rearranges letters by writing them diagonally across rows (rails) and reading them row by row.
Atbash is a monoalphabetic substitution with the unique property of being self-inverse — applying it twice returns the original text. This makes it simple to use: switch between encrypt and decrypt as needed. An optional digit reversal mode maps 0↔9, 1↔8, 2↔7, and so on, extending the cipher's reach to numeric content.
The Rail Fence cipher writes text across a configurable number of rails (2 to 10). For example, with 3 rails, the text "HELLO WORLD" is written diagonally across three rows, creating a zigzag pattern. The encrypted text is formed by reading row by row. The rail pattern visualization shows exactly how each letter is placed on each rail, making the transposition clear.
Both ciphers are intended for learning, puzzles, and historical interest. Neither provides any real security against modern cryptanalysis. The Rail Fence cipher can be cracked by trying different rail counts (only 2-10 possibilities) and looking for readable output.