1001Ferramentas
📊 Security

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?
No. Modern ciphers produce a near uniform distribution, and frequency analysis only bites on classical substitution and transposition.
Why do my bigrams look odd?
Spaces are stripped before counting, so pairs and triples span the end of one word and the start of the next.
How much ciphertext do I need?
Around 200 letters gives a usable ranking. With a single short sentence the observed frequencies say more about chance than about the cipher.

Related Tools