Monoalphabetic Substitution Cipher
Encrypt/decrypt with a custom A-Z substitution key and show letter frequencies for didactic analysis.
—
Monoalphabetic substitution with the full permutation
This is the general form of which Caesar, Atbash and the keyword cipher are special cases: you declare where each of the 26 letters goes, with no restriction. The key space is 26 factorial, a number with 27 digits — if each key took a microsecond, trying them all would take longer than the age of the universe.
Enter the full permutation, 26 letters with no repeats, and the text. The page validates the key before anything else: fewer than 26 letters, a missing letter or a repeated one are refused with the reason, because an invalid permutation would produce a cipher with no way back. The reverse direction deciphers using the mapping read backwards.
The size of the key space does not make it secure, and that is the cipher's most useful lesson. Brute force is impractical, but nobody needs it: letter frequency survives intact, and with a paragraph a cryptanalyst identifies the commonest letters, deduces the digrams and fills the rest in by word pattern. It is the classic example that a large key does not imply security.
Frequently asked questions
If there are that many keys, why is the cipher weak?
How do I build a good permutation?
Is this the same as a newspaper cryptogram?
Related Tools
Frequency Analysis to Break Ciphers
Count letter, bigram and trigram frequencies in ciphertext and compare with Portuguese/English references.
ADFGVX Cipher: Substitution Step
Encodes text on a fixed unkeyed 6x6 Polybius square of A-Z and 0-9, turning each character into its ADFGVX pair. No columnar transposition.
A1Z26 Cipher
Converts text into numbers by each letter position in the alphabet (A=1, Z=26), separated by hyphens. A simple cipher popular in geocaching, escape rooms and logic puzzles.
Bacon Cipher
Encodes text with the Bacon cipher, replacing each letter with a group of five As and Bs. Uses the modern 26-letter alphabet, keeping I and J apart.
ROT13 Cipher
Apply the ROT13 cipher (rotate by 13 letters) to text. Applying twice returns the original. Used in forums to hide spoilers. Only A–Z and a–z are affected. Everything in your browser.
ROT47 Cipher
Apply the ROT47 cipher (rotation across 47 printable ASCII chars 33–126). Wider than ROT13: covers numbers and symbols. Applying twice returns the original. Everything in your browser.