Frequency Analysis to Break Ciphers
Count letter, bigram and trigram frequencies in ciphertext and compare with Portuguese/English references.
—
Letter counts against classical ciphers
A ciphertext lands in your lap from a CTF, a coursework exercise or an old puzzle, and you suspect a simple substitution. Paste it in and you get the top ten letters with their percentages, plus the ten most common bigrams and trigrams, next to reference tables for Portuguese and English. The example already loaded in the box is a Caesar cipher shifted by three.
Before counting, anything that is not an A to Z letter is dropped: spaces, digits, punctuation and accented characters too, so a c-cedilla or an a-tilde disappears from the tally. Because spaces are gone, bigrams and trigrams run across word boundaries, which is why the top trigram is not always a real word. In Portuguese, A and E dominate at roughly 14.6% and 12.6%; in English the leaders are E and T. Below about 200 letters the ranking is mostly statistical noise.
The page counts, you solve: there is no automatic mapping and no attempt to crack the cipher for you. The method works against Caesar and monoalphabetic substitution. For Vigenere you first have to find the key length and split the text into columns, which this page does not do, since it computes no index of coincidence. A nearly flat histogram is itself a finding, because modern ciphers spread bytes evenly. Everything runs in your browser.
Frequently asked questions
Can this break AES or a password?
Why do my bigrams look odd?
How much ciphertext do I need?
Related Tools
Monoalphabetic Substitution Cipher
Encrypt/decrypt with a custom A-Z substitution key and show letter frequencies for didactic analysis.
Baconian Cipher, 5-Bit A/B Groups
Encodes each letter as a group of five A and B symbols in Bacon's 24-letter alphabet, where I shares a code with J and U shares one with V.
Beaufort Cipher
Enciphers letters with the Beaufort cipher, a reciprocal Vigenere variant where each output letter is key minus plaintext mod 26, so the key also decodes.
Polybius Cipher
Encode text with the Polybius cipher (5x5 square, I/J merged). Each letter becomes a row/column digit pair. Useful for puzzles and classical cryptography.
Kasiski Test for Vigenère
Find repeated trigrams in ciphertext, compute GCD of distances and suggest the Vigenère key length.
Vigenère Autokey Cipher Encoder and Decoder
Enciphers or deciphers text with the classic autokey variant, where the plaintext extends the keyword instead of repeating it. Letters A to Z only.