Classical Ciphers

Atbash, Affine, A1Z26, Polybius, Rail Fence, and Beaufort cipher - encode and decode instantly.

Input
Examples
Click to load
Plaintext: HELLO WORLD
Ciphertext: SVOOL DLIOW (Atbash of HELLO WORLD)
Output (Atbash is reciprocal - same operation)
About Atbash

Atbash is a monoalphabetic substitution cipher that maps each letter to its mirror: A↔Z, B↔Y, C↔X, … It is its own inverse (reciprocal), so encoding and decoding are the same operation. Originally used for the Hebrew alphabet.

Options
a (slope): b (offset): E(x) = (a·x + b) mod 26
Input
Output
About Affine cipher

The Affine cipher maps each letter x to (a·x + b) mod 26. The key is the pair (a, b). For decryption: D(y) = a⁻¹·(y − b) mod 26. Only values of a coprime to 26 are valid (1,3,5,7,9,11,15,17,19,21,23,25).

Input
Examples
Click to load
Encode plaintext: HELLO
Decode CTF{ish}: 3-20-6 → CTF
Decode 6-12-1-7 → FLAG
Output
About A1Z26

A1Z26 substitutes each letter with its ordinal: A=1, B=2, …, Z=26. Numbers are separated by hyphens. Spaces between words are preserved as "/" in output.

Polybius Square (I/J combined)
Input
Output
Rails: (2–10)
Input
Output
About Rail Fence

Rail Fence is a transposition cipher. The plaintext is written in a zigzag pattern across n rails, then read off row by row. For example, "HELLO WORLD" on 3 rails:
H . . . O . . . L .
. E . L . W . R . D
. . L . . . O . . .

Read off: "HOOL ELWRDLO"

Key: letters only - Beaufort is reciprocal
Input
Output (same operation either direction)
About Beaufort cipher

The Beaufort cipher is similar to Vigenère but uses the formula C = (K − P) mod 26, where K is the key letter index and P is the plaintext letter index. It is reciprocal (the same operation encrypts and decrypts). It was used in rotor machines and is related to the Variant Beaufort / Vigenère family.