Classical Ciphers

Encode and decode text using classical algorithms: Caesar, ROT13, ROT47, Atbash, Affine, A1Z26, and Rail Fence. Supports custom parameters. Ideal for cryptography education and learning.

Algorithm Selection

Usage

Algorithm Introduction

Caesar Cipher: each letter is shifted by a fixed amount, the oldest substitution cipher; ROT13: Caesar cipher with shift 13 (self-reciprocal since alphabet has 26 letters); ROT47: rotates ASCII characters 33-126 by 47 positions; Atbash: maps each letter to its mirror (self-reciprocal); Affine Cipher: linear substitution E(x)=(ax+b) mod 26, requires a coprime to 26; A1Z26: one-to-one mapping between letters and numbers (a=1, b=2, ..., z=26); Rail Fence: transposition cipher writing plaintext in a zigzag pattern across rails.

Steps

1. Select a cipher algorithm from the left panel; 2. Configure algorithm-specific parameters (shift, A/B, rails, etc.); 3. Enter text in the input box; 4. Click 'Encode' or 'Decode' to process; 5. View the result in the output area, click 'Copy' to copy.

Notes

Caesar cipher only processes English letters; other characters remain unchanged. Affine parameter A must be coprime to 26 (valid: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25). Rail Fence requires at least 2 rails. A1Z26 encodes lowercase letters to numbers and decodes numbers to letters. ROT13 and ROT47 are self-reciprocal (encoding twice restores the original).