FACTOID # 14: North Carolina has a larger Native American population than North Dakota, South Dakota and Montana combined.

 Home Encyclopedia Statistics States A-Z Flags Maps FAQ About

 WHAT'S NEW

SEARCH ALL

Search encyclopedia, statistics and forums:

(* = Graphable)

Encyclopedia > Frequency analysis (cryptanalysis)
A typical distribution of letters in English language text. Weak ciphers do not sufficiently mask the distribution, and this might be exploited by a cryptanalyst to read the message.

In cryptanalysis, frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. The method is used as an aid to breaking classical ciphers. English single letter frequencies. ... English single letter frequencies. ... The English language is a West Germanic language that originates in England. ... Cryptanalysis (from the Greek kryptÃ³s, hidden, and analÃ½ein, to loosen or to untie) is the study of methods for obtaining the meaning of encrypted information, without access to the secret information which is normally required to do so. ... The factual accuracy of this article is disputed. ... This article is about algorithms for encryption and decryption. ... In cryptography, a classical cipher is a type of cipher used historically but which now have fallen, for the most part, into disuse. ...

Frequency analysis is based on the fact that, in any given stretch of written language, certain letters and combinations of letters occur with varying frequencies. Moreover, there is a characteristic distribution of letters that is roughly the same for almost all samples of that language. For instance, given a section of English language, E tends to be very common, while X is very rare. Likewise, ST, NG, TH, and QU are common pairs of letters (termed bigrams or digraphs), while NZ and QJ are rare. The phrase "ETAOIN SHRDLU" encodes the 12 most frequent letters in typical English language text. The English language is a West Germanic language that originates in England. ... Bigrams are groups of two written letters, two syllables, or two words, and are very commonly used as the basis for simple statistical analysis of text; one of the most successful language models for Speech Recognition (Collins, 1996). ... // ETAOIN SHRDLU (pronounced etwan sherdloo) is the approximate order of frequency of the twelve most commonly used letters in the English language, best known as a nonsense phrase that sometimes appeared in print in the days of hot type publishing due to a custom of Linotype machine operators. ...

In some ciphers, such properties of the natural language plaintext are preserved in the ciphertext, and these patterns have the potential to be exploited in a ciphertext-only attack. In cryptography, a ciphertext-only attack is a form of cryptanalysis where the attacker is assumed to have access only to a set of ciphertexts. ...

## Frequency analysis for simple substitution ciphers GA_googleFillSlot("encyclopedia_square");

In a simple substitution cipher, each letter of the plaintext is replaced with another, and any particular letter in the plaintext will always be transformed into the same letter in the ciphertext. For instance, all e's will turn into X's. A ciphertext message containing lots of X's would suggest to a cryptanalyst that X represented e. In cryptography, a substitution cipher is a method of encryption by which units of plaintext are substituted with ciphertext according to a regular system; the units may be single letters (the most common), pairs of letters, triplets of letters, mixtures of the above, and so forth. ... In cryptography, plaintext is information used as input to an encryption algorithm; the output is termed ciphertext. ...

The basic use of frequency analysis is to first count the frequency of ciphertext letters and then associate guessed plaintext letters with them. More X's in the ciphertext than anything else suggests that X corresponds to e in the plaintext, but this is not certain; t and a are also very common in English, so X might be either of them also. It is unlikely to be a plaintext z or q which are less common. Thus the cryptanalyst may need to try several combinations of mappings between ciphertext and plaintext letters.

More complex use of statistics can be conceived, such as considering counts of pairs of letters, or triplets (trigrams), and so on. This is done to provide more information to the cryptanalyst, for instance, Q and U nearly always occur together in that order in English, even though Q itself is rare.

### An example

Suppose Eve has intercepted the cryptogram below, and it is known to be encrypted using a simple substitution cipher: A cryptogram is a short piece of text encrypted with a simple substitution cipher in which each letter is replaced by a different letter. ...

` LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIPFEMVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERIM WQLMGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEVEKEITREWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXRSJ GSTVRIEYVIEXCVMUIMWERGMIWXMJMGCSMWXSJOMIQXLIVIQIVIXQSVSTWHKPEGARCSXRWIEVSWIIBXV IZMXFSJXLIKEGAEWHEPSWYSWIWIEVXLISXLIVXLIRGEPIRQIVIIBGIIHMWYPFLEVHEWHYPSRRFQMXLE PPXLIECCIEVEWGISJKTVWMRLIHYSPHXLIQIMYLXSJXLIMWRIGXQEROIVFVIZEVAEKPIEWHXEAMWYEPP XLMWYRMWXSGSWRMHIVEXMSWMGSTPHLEVHPFKPEZINTCMXIVJSVLMRSCMWMSWVIRCIGXMWYMX `

For this example, uppercase letters are used to denote ciphertext, lowercase letters are used to denote plaintext (or guesses at such), and X~t is used to express a guess that ciphertext letter X represents the plaintext letter t.

Eve could use frequency analysis to help solve the message along the following lines: counts of the letters in the cryptogram show that I is the most common single letter, XL most common bigram, and XLI is the most common trigram. e is the most common letter in the English language, th is the most common bigram, and the the most common trigram. This strongly suggests that X~t, L~h and I~e. The second most common letter in the cryptogram is E; since the first and second most frequent letters in the English language, e and t are accounted for, Eve guesses that E~a, the third most frequent letter. Tentatively making these assumptions, the following partial decrypted message is obtained.

` heVeTCSWPeYVaWHaVSReQMthaYVaOeaWHRtatePFaMVaWHKVSTYhtZetheKeetPeJVSZaYPaRRGaReM WQhMGhMtQaReWGPSReHMtQaRaKeaTtMJTPRGaVaKaeTRaWHatthattMZeTWAWSQWtSWatTVaPMRtRSJ GSTVReaYVeatCVMUeMWaRGMeWtMJMGCSMWtSJOMeQtheVeQeVetQSVSTWHKPaGARCStRWeaVSWeeBtV eZMtFSJtheKaGAaWHaPSWYSWeWeaVtheStheVtheRGaPeRQeVeeBGeeHMWYPFhaVHaWHYPSRRFQMtha PPtheaCCeaVaWGeSJKTVWMRheHYSPHtheQeMYhtSJtheMWReGtQaROeVFVeZaVAaKPeaWHtaAMWYaPP thMWYRMWtSGSWRMHeVatMSWMGSTPHhaVHPFKPaZeNTCMteVJSVhMRSCMWMSWVeRCeGtMWYMt `

Using these initial guesses, Eve can spot patterns that confirm her choices, such as "that". Moreover, other patterns suggest further guesses. "Rtate" might be "state", which would mean R~s. Similarly "atthattMZe" could be guessed as "atthattime", yielding M~i and Z~m. Furthermore, "heVe" might be "here", giving V~r. Filling in these guesses, Eve gets:

` hereTCSWPeYraWHarSseQithaYraOeaWHstatePFairaWHKrSTYhtmetheKeetPeJrSmaYPassGasei WQhiGhitQaseWGPSseHitQasaKeaTtiJTPsGaraKaeTsaWHatthattimeTWAWSQWtSWatTraPistsSJ GSTrseaYreatCriUeiWasGieWtiJiGCSiWtSJOieQthereQeretQSrSTWHKPaGAsCStsWearSWeeBtr emitFSJtheKaGAaWHaPSWYSWeWeartheStherthesGaPesQereeBGeeHiWYPFharHaWHYPSssFQitha PPtheaCCearaWGeSJKTrWisheHYSPHtheQeiYhtSJtheiWseGtQasOerFremarAaKPeaWHtaAiWYaPP thiWYsiWtSGSWsiHeratiSWiGSTPHharHPFKPameNTCiterJSrhisSCiWiSWresCeGtiWYit `

In turn, these guesses suggest still others (for example, "remarA" could be "remark", implying A~k) and so on, and it is relatively straightforward to deduce the rest of the letters, eventually yielding the plaintext.

In this example, Eve's guesses were all correct. This would not always be the case, however; the variation in statistics for individual plaintexts can mean that initial guesses are incorrect. It may be necessary to backtrack incorrect guesses or to analyze the available statistics in much more depth than the somewhat simplified justifications given in the above example. This article or section does not cite its references or sources. ...

It is also possible that the plaintext does not exhibit the expected distribution of letter frequencies. Shorter messages are likely to show more variation. It is also possible to construct artificially skewed texts. For example, entire novels have been written that omit the letter "e" altogether — a form of literature known as a lipogram. A lipogram (from Greek lipagrammatos, missing letter) is a kind of writing with constraints or word game consisting of writing paragraphs or longer works in which a particular letter or group of letters is missing, usually a common vowel, the most common in English being e (McArthur, 1992). ...

## History and usage

First page of Al-Kindi's 9th century Manuscript on Deciphering Cryptographic Messages

The first known recorded explanation of frequency analysis (indeed, of any kind of cryptanalysis) was given by 9th century Arab polymath Abu Yusuf Yaqub ibn Ishaq al-Sabbah Al-Kindi in A Manuscript on Deciphering Cryptographic Messages (Prof. Ibrahim Al-Kadi, 1992- see References). It has been suggested that close textual study of the Qur'an first brought to light that Arabic has a characteristic letter frequency. Its use spread, and was so widely used by European states by the Renaissance that several schemes were invented by cryptographers to defeat it. These included: The first page of al-Kindis manuscript On Deciphering Cryptographic Messages, containing the oldest known description of cryptanalysis by frequency analysis. ... The first page of al-Kindis manuscript On Deciphering Cryptographic Messages, containing the oldest known description of cryptanalysis by frequency analysis. ... Ab&#363;-Y&#363;suf Ya&#8217;q&#363;b ibn Ish&#257;q al-Kind&#299; (c. ... As a means of recording the passage of time the 9th century was that century that lasted from 801 to 900. ... For other uses, see Arab (disambiguation). ... Leonardo da Vinci is seen as an epitome of the Renaissance man or polymath A polymath (Greek polymathÄ“s, Ï€Î¿Î»Ï…Î¼Î±Î¸Î®Ï‚, meaning knowing, understanding, or having learnt in quantity, compounded from Ï€Î¿Î»Ï…- much, many, and the root Î¼Î±Î¸-, meaning learning, understanding[1]) is a person well educated in a wide variety of subjects or... Al-Kindi (Arabic: &#1571;&#1576;&#1608; &#1610;&#1593;&#1602;&#1608;&#1576; &#1610;&#1608;&#1587;&#1601; &#1576;&#1606; &#1573;&#1587;&#1581;&#1575;&#1602; &#1575;&#1604;&#1603;&#1606;&#1583;&#1610;) was a Arabn philosopher, scientist and ophthalmologist. ... The QurÄn [1] (Arabic: â€Ž, literally the recitation; also called The Noble QurÄn; also transliterated as Quran, Koran, and Al-Quran) is the central religious text of Islam. ... Arabic ( or just ) is the largest living member of the Semitic language family in terms of speakers. ...

• Use of homophones — several alternatives to the most common letters in otherwise monoalphabetic substitution ciphers (for example, for English, both X and Y ciphertext might mean plaintext E).
• Polyalphabetic substitution, that is, the use of several alphabets — chosen in assorted, more or less devious, ways (Leone Alberti seems to have been the first to propose this); and
• Polygraphic substitution, schemes where pairs or triplets of plaintext letters are treated as units for substitution, rather than single letters (for example, the Playfair cipher invented by Charles Wheatstone in the mid 1800s).

A disadvantage of all these attempts to defeat frequency counting attacks is that it increases complication of both enciphering and deciphering, leading to mistakes. Famously, a British Foreign Secretary is said to have rejected the Playfair cipher because, even if school boys could cope successfully as Wheatstone and Playfair had shown, 'our attachés could never learn it!'. A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. ... Leone Battista Alberti (February 1404 - 25th April 1472), Italian painter, poet, linguist, philosopher, cryptographer, musician, architect, and general Renaissance polymath . ... The Playfair system was invented by Charles Wheatstone, who first described it in 1854. ... Charles Wheatstone Sir Charles Wheatstone (February 6, 1802 - October 19, 1875) was the British inventor of many innovations including the English concertina the Stereoscope an early form of microphone the Playfair cipher (named for Lord Playfair, the person who publicized it) He was a major figure in the development of...

The rotor machines of the first half of the 20th century (for example, the Enigma machine) were essentially immune to straightforward frequency analysis. However, other kinds of analysis ("attacks") successfully decoded messages from some of those machines. In cryptography, a rotor machine is a electro-mechanical device used for encrypting and decrypting secret messages. ... The plugboard, keyboard, lamps and finger-wheels of the rotors emerging from the inner lid of a three-rotor German military Enigma machine (version with labels) In the history of cryptography, the Enigma was a portable cipher machine used to encrypt and decrypt secret messages. ...

Frequency analysis requires only a basic understanding of the statistics of the plaintext language and some problem solving skills, and, if performed by hand, some tolerance for extensive letter bookkeeping. During World War II (WWII), both the British and the Americans recruited codebreakers by placing crossword puzzles in major newspapers and running contests for who could solve them the fastest. Several of the ciphers used by the Axis powers were breakable using frequency analysis (for example, some of the consular ciphers used by the Japanese). Mechanical methods of letter counting and statistical analysis (generally IBM card type machinery) were first used in WWII, possibly by the US Army's SIS. There are lurid tales of midnight expeditions by the cryptographers to machines in another Department. Today, the hard work of letter counting and analysis has been replaced by computer software, which can carry out such analysis in seconds. With modern computing power, classical ciphers are unlikely to provide any real protection for confidential data. Combatants Allied Powers Axis Powers Casualties Military dead: 17,000,000 Civilian dead: 33,000,000 Total dead: 50,000,000 Military dead: 8,000,000 Civilian dead: 4,000,000 Total dead 12,000,000 World War II (abbreviated WWII), or the Second World War, was a worldwide conflict... A crossword is a word puzzle that normally takes the form of a square grid of black and white squares. ... This article or section does not cite its references or sources. ... The Signals Intelligence Service (SIS) was the United States Army codebreaking division, headquartered at Arlington Hall. ... A BlueGene supercomputer cabinet. ... Computer software (or simply software) refers to one or more computer programs and data held in the storage of a computer for some purpose. ...

## Frequency analysis in fiction

Frequency analysis has been described in fiction. Edgar Allan Poe's The Gold Bug, and Arthur Conan Doyle's Sherlock Holmes tale The Adventure of the Dancing Men are examples of stories which describe the use of frequency analysis to attack simple substitution ciphers. The cipher in the Poe story is encrusted with several deception measures, but this is more a literary device than anything significant cryptographically. From The Adventure of the Dancing Men Sherlock Holmes story. ... Edgar Allan Poe (January 19, 1809 â€“ October 7, 1849) was an American poet, short story writer, editor, critic and one of the leaders of the American Romantic Movement. ... The Gold Bug is a short story by Edgar Allan Poe. ... Sir Arthur Ignatius Conan Doyle, DL (22 May 1859 â€“ 7 July 1930) was a Scottish author most noted for his stories about the detective Sherlock Holmes, which are generally considered a major innovation in the field of crime fiction, and the adventures of Professor Challenger. ... Sherlock Holmes as imagined by the seminal Holmesian artist, Sidney Paget, in The Strand Magazine. ... The Adventure of the Dancing Men, one of the 56 Sherlock Holmes short stories written by British author Sir Arthur Conan Doyle, is one of 13 stories in the cycle collected as The Return of Sherlock Holmes. ...

// ETAOIN SHRDLU (pronounced etwan sherdloo) is the approximate order of frequency of the twelve most commonly used letters in the English language, best known as a nonsense phrase that sometimes appeared in print in the days of hot type publishing due to a custom of Linotype machine operators. ... The factual accuracy of this article is disputed. ... This article is intended to be an analytic glossary, or alternatively, an organized collection of annotated pointers. ... Originally, Zipfs law stated that, in a corpus of natural language utterances, the frequency of any word is roughly inversely proportional to its rank in the frequency table. ...

## References

• Helen Fouché Gaines, "Cryptanalysis", 1939, Dover. ISBN 0-486-20097-3
• Ibrahim A. Al-Kadi "The origins of cryptology: The Arab contributions”, Cryptologia, 16(2) (April 1992) pp. 97–126.
• Abraham Sinkov, "Elementary Cryptanalysis : A Mathematical Approach", The Mathematical Association of America, 1966. ISBN 0-88385-622-0.

Cryptologia is a journal in cryptography published quarterly since 1977. ... Dr. Abraham Sinkov (1907-1998) was a US cryptanalyst. ...

Share your thoughts, questions and commentary here