Tools for frequency analysis, a cryptanalysis method studying the frequency of letters or groups of characters in a ciphered message.
Frequency Analysis - dCode
Tag(s) : Cryptanalysis
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Frequency analysis is the study of the distribution (and count) of the letters in a text. Analysis of frequencies helps cryptanalysis and decrypting substitution-based ciphers using the fact that some letters apparitions are varying in a given language: in English, letters E, T or A are common while Z or Q are rare.
Frequency analysis generates a histogram that allows statistical distributions to be compared with those of a reference model (the plaintext language). This comparison can theoretically help decipher a text by comparing the frequencies of occurrence of letters in the encrypted message with the theoretical frequencies of occurrence of letters in the plaintext language.
Frequency analysis attack is particularly effective on monoalphabetic ciphers. These systems do not modify the statistical distribution of letters, which allows a correspondence to be established between the ciphertext and the plaintext.
To perform an alphabetic substitution using frequency analysis, the most frequent symbol must be replaced with the letter E (which is the most frequent letter in English), and the others deduced from this. This principle is only truly applicable if the cryptogram contains a large number of symbols so that the frequencies are statistically significant.
Frequency analysis is not limited to individual letters but can also be applied to groups of letters (ngrams) for polygram ciphers.
Some ciphers are characterized by the presence or absence of repeated letters in a bigram or trigram.
For some ngrams analyzes, use the sliding window mode:
Example: ABCD has bigrams AB, CD '(blocks mode)
Example: ABCD has bigrams AB, BC, CD '(sliding window mode)
If the text is too short then the statistical variations are too large and the frequency analysis is less precise.
Frequency analysis is also less relevant when the message has been encrypted with polyalphabetic encryption (which tends to randomize the frequency of the letters), or when the encryption is homophonic (several different encrypted characters for the same plain letter) or polygrammic (groups of characters replace each letter). In these cases, the analysis does not allow a decoding but allows to filter or find the type of encryption used.
Letters by frequency of appearance in English:
E | 12.7 % | M | 2.4 % |
---|---|---|---|
T | 9.1 % | W | 2.4 % |
A | 8.2 % | F | 2.2 % |
O | 7.5 % | G | 2.0 % |
I | 7.0 % | Y | 2.0 % |
N | 6.7 % | P | 1.9 % |
S | 6.3 % | B | 1.5 % |
H | 6.1 % | V | 1.0 % |
R | 6.0 % | K | 0.8 % |
L | 4.0 % | J | 0.2 % |
D | 4.3 % | X | 0.2 % |
C | 2.8 % | Q | 0.1 % |
U | 2.8 % | Z | 0.1 % |
For comparison purposes, here are letters frequency in French:
E | 17.3 % | P | 3.0 % |
---|---|---|---|
A | 8.4 % | G | 1.3 % |
S | 8.1 % | V | 1.3 % |
I | 7.3 % | B | 1.1 % |
N | 7.1 % | F | 1.1 % |
T | 7.1 % | Q | 1.0 % |
R | 6.6 % | H | 0.9 % |
L | 6.0 % | X | 0.4 % |
U | 5.7 % | J | 0.3 % |
O | 5.3 % | Y | 0.3 % |
D | 4.2 % | K | 0.1 % |
C | 3.0 % | W | 0.1 % |
M | 3.0 % | Z | 0.1 % |
dCode retains ownership of the "Frequency Analysis" source code. Except explicit open source licence (indicated Creative Commons / free), the "Frequency Analysis" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Frequency Analysis" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Frequency Analysis" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Frequency Analysis" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Frequency Analysis on dCode.fr [online website], retrieved on 2025-03-28,