<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="812"/><title>Attacking Decipherment Problems Optimally with Low-Order N-gram Models</title><author surname="Ravi" givenname="Sujith"><org  name="University of Southern California" country="USA" city="Marina del Rey"/></author><author surname="Knight" givenname="Kevin"><org  name="University of Southern California" country="USA" city="Marina del Rey"/></author></firstpageheader><frontmatter><p><b>Attacking Decipherment Problems Optimally with Low-Order N-gram</b></p><p><b>Models</b></p><p><b>Sujith Ravi and Kevin Knight</b></p><p>University of Southern California</p><p>Information Sciences Institute Marina del Rey, California 90292</p><p>{sravi,knight}@isi.edu</p></frontmatter><abstract>We introduce a method for solving substi­tution ciphers using low-order letter n-gram models. This method enforces global con­straints using integer programming, and it guarantees that no decipherment key is over­looked. We carry out extensive empirical ex­periments showing how decipherment accu­racy varies as a function of cipher length and n-gram order. We also make an empirical in­vestigation of Shannon's (1949) theory of un­certainty in decipherment. </abstract></header><body><section number="1" title="Introduction"><p>A number of papers have explored algorithms for automatically solving letter-substitution ciphers. Some use heuristic methods to search for the best de­terministic key (Peleg and Rosenfeld, 1979; Gane-san and Sherman, 1993; Jakobsen, 1995; Olson, 2007), often using word dictionaries to guide that search. Others use expectation-maximization (EM) to search for the best probabilistic key using letter n-gram models (Knight et al., 2006). In this paper, we introduce an exact decipherment method based on integer programming. We carry out extensive de­cipherment experiments using letter n-gram models, and we find that our accuracy rates far exceed those of EM-based methods.</p><p>We also empirically explore the concepts in Shan­non's (1949) paper on information theory as applied to cipher systems. We provide quantitative plots for uncertainty in decipherment, including the famous <i>unicity distance, </i>which estimates how long a cipher must be to virtually eliminate such uncertainty.</p><p>We find the ideas in Shannon's (1949) paper rel­evant to problems of statistical machine translation and transliteration. When first exposed to the idea of statistical machine translation, many people natu­rally ask: (1) how much data is needed to get a good result, and (2) can translation systems be trained without parallel data? These are tough questions by any stretch, and it is remarkable that Shannon was already in the 1940s tackling such questions in the realm of code-breaking, creating analytic formulas to estimate answers.</p><p>Our novel contributions are as follows:</p><p>• We outline an exact letter-substitution deci­pherment method which:</p><p>- guarantees that no key is overlooked, and - can be executed with standard integer pro­gramming solvers</p><p>• We present empirical results for decipherment which:</p><p>- plot search-error-free decipherment results at various cipher lengths, and - demonstrate accuracy rates superior to EM-based methods</p><p>• We carry out empirical testing of Shannon's formulas for decipherment uncertainty</p></section><section number="2" title="Language Models"><p>We work on letter substitution ciphers with spaces. We look for the key (among 26! possible ones) that, when applied to the ciphertext, yields the most English-like result. We take "English-like" to mean</p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">812</doubt><p><i>Proceedings of the 2008 Conference on Empirical Methods in Natural Language Processing, </i>pages 812-819, Honolulu, October 2008. ©2008 Association for Computational Linguistics<page local="2" global="813"/></p><p>most probable according to some statistical lan­guage model, whose job is to assign some proba­bility to any sequence of letters. According to a 1-gram model of English, the probability of a plaintext <i>p</i><i>i</i><i>...p</i><i>n </i>is given by:</p><doubt alpha="32.4" length="37" tooSmall="False" monospace="0.0">P(pi...p„) = P(pi)• P(p2)• ... •P(Pn)</doubt><p>That is, we obtain the probability of a sequence by multiplying together the probabilities of the in­dividual letters that make it up. This model assigns a probability to any letter sequence, and the proba­bilities of all letter sequences sum to one. We col­lect letter probabilities (including space) from 50 million words of text available from the Linguistic Data Consortium (Graff and Finch, 1994). We also estimate 2- and 3-gram models using the same re­sources:</p><doubt alpha="38.1" length="84" tooSmall="False" monospace="0.0">P (pi...pn)=     P (Pi|START) • P(p2|pi)• P (P3| P2)• ... • P(Pn| Pn-i)• P(END | Pn)</doubt><doubt alpha="48.9" length="45" tooSmall="False" monospace="0.0">P (Pi...Pn)=   P (Pi|START) • P(P2| STARTpi)•</doubt><doubt alpha="46.8" length="47" tooSmall="False" monospace="0.0">P(P3| PiP2)• ... • P(Pn|Pn-2Pn-i)•P(END|Pn-iPn)</doubt><p>Unlike the 1-gram model, the 2-gram model will assign a low probability to the sequence "ae" be­cause the probability P(e | a) is low. Of course, all these models are fairly weak, as already known by (Shannon, 1949). When we stochastically generate text according to these models, we get, for example:</p><p>1- gram: ... thdo detusar ii c ibt deg irn toihytrsen ...</p><p>2- gram: ... itariaris s oriorcupunond rke uth ...</p><p>3- gram: ... ind thnowelf jusision thad inat of ...</p><p>4- gram: ... rece bence on but ther servier ...</p><p>5- gram: ... mrs earned age im on d the perious ...</p><p>6- gram: ... a party to possible upon rest of ...</p><p>7- gram: ... t our general through approve the ...</p><p>We can further estimate the probability of a whole English sentence or phrase. For example, the prob­abilities of two plaintext phrases "het oxf" and "the fox" (which have the same letter frequency distribution) is shown below. The 1-gram model which counts only the frequency of occurrence of each letter in the phrase, estimates the same proba­bility for both the phrases "het oxf" and "the fox", since the same letters occur in both phrases. On the other hand, the 2-gram and 3-gram models, which take context into account, are able to distinguish be­tween the English and non-English phrases better, and hence assign a higher probability to the English phrase "the fox".</p><p>Over a longer sequence X of length N, we can also calculate <i>—log2(P</i>(X))/N, which (per Shan­non) gives the compression rate permitted by the model, in bits per character. In our case, we get:<footnote anchor="1"/></p><doubt alpha="30.8" length="13" tooSmall="False" monospace="0.0">1- gram: 4.19</doubt><doubt alpha="30.8" length="13" tooSmall="False" monospace="0.0">2- gram: 3.51</doubt><doubt alpha="30.8" length="13" tooSmall="False" monospace="0.0">3- gram: 2.93</doubt></section><section number="3" title="Decipherment"><p>Given a ciphertext <i>c1...cn,we </i>search for the key that yields the most probable plaintext <i>p1...pn. </i>There are 26! possible keys, too many to enumerate. How­ever, we can still find the best one in a guaranteed fashion. We do this by taking our most-probable-plaintext problem and casting it as an integer pro­gramming problem.<footnote anchor="2"/></p><p>Here is a sample integer programming problem:</p><p>variables:  <i>x, y </i>minimize:</p><doubt alpha="50.0" length="4" tooSmall="False" monospace="0.0">2x+y</doubt><p>subject to:</p><doubt alpha="17.4" length="23" tooSmall="False" monospace="0.0">x + y &lt; 6.9 y — x &lt; 2.5</doubt><doubt alpha="20.0" length="5" tooSmall="False" monospace="0.0">y&gt;1.1</doubt><p>We require that x and y take on integer values. A solution can be obtained by typing this integer pro­gram into the publicly available <i>Ipsolve </i>program, subject to:<page local="3" global="814"/></p><footnote label="1">Because spacing is fixed in our letter substitution ciphers, we normalize P (X  )  by the sum of probabilities of all English strings that match the spacing pattern of X.</footnote><footnote label="2">For an overview of integer and linear programming, see for example (Schrijver, 1998).</footnote><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">813</doubt><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>Model</b></p></td><td class="cell"><p>P(het oxf)</p></td><td class="cell"><p>P(the fox)</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>1-gram</p></td><td class="cell"><p>1.83 x 10-9</p></td><td class="cell"><p>1.83 x 10-9</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>2-gram</p></td><td class="cell"><p>3.26 x 10-11</p></td><td class="cell"><p>1.18 x 10-7</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>3-gram</p></td><td class="cell"><p>1.89 x 10-13</p></td><td class="cell"><p>1.04 x 10-6</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><p>Figure 1: A decipherment network. The beginning of the ciphertext is shown at the top of the figure (underscores represent spaces). Any left-to-right path through the network constitutes a potential decipherment. The bold path corresponds to the decipherment "decade". The dotted path corresponds to the decipherment "ababab". Given a cipher length of n, the network has 27 • 27 • (n — 1) links and 27n paths. Each link corresponds to a named variable in our integer program. Three links are shown with their names in the figure.</p><p>or the commercially available <i>CP LEX </i>program, which yields the result: x = 4, y = 2.</p><p>Suppose we want to decipher with a 2-gram lan­guage model, i.e., we want to find the key that yields the plaintext of highest 2-gram probability. Given the ciphertext <i>c</i><b>1 </b><i>...c</i><i>n, </i>we create an integer program­ming problem as follows. First, we set up a net­work of possible decipherments (Figure 1). Each of the 27 • 27 • (n — 1) links in the network is a binary variable in the integer program—it must be assigned a value of either 0 or 1. We name these variables <i>link</i><i>xYZ</i>, where X indicates the column of the link's source, and <i>Y </i>and <i>Z </i>represent the rows of the link's source and destination (e.g. variables <i>link</i><i>1aa, </i><i>link</i><i>1ab, </i><i>link5qu,</i>...).</p><p>Each distinct left-to-right path through the net­work corresponds to a different decipherment. For example, the bold path in Figure 1 corresponds to the decipherment "decade". Decipherment amounts to turning some links "on" (assigning value 1 to the link variable) and others "off" (assigning value 0). Not all assignments of 0's and 1's to link variables result in a coherent left-to-right path, so we must place some "subject to" constraints in our integer program.</p><p>We observe that a set of variables forms a path if, for every node in columns 2 through n — 1 of the net­work, the following property holds: the sum of the values of the link variables entering the node equals the sum of the link variables leaving the node. For nodes along a chosen decipherment path, this sum will be 1, and for others, it will be 0.<footnote anchor="3"/> Therefore, we create one "subject to" constraint for each node ("_" stands for space). For example, for the node in column 2, row <i>e </i>we have:</p><p><i>link1ae </i>+ <i>link1be </i>+ <i>link1ce </i>+ ... + <i>link1_e</i>= <i>link</i><i>2ea </i>+ <i>link</i><i>2eb </i>+ <i>Hnk</i><i>2ec </i>+ <i>... </i>+ <i>link</i><i>2e_ </i>Now we set up an expression for the "minimize" part of the integer program. Recall that we want to select the plaintext <i>p1...pn </i>of highest probability. For the 2-gram language model, the following are equivalent:</p><doubt alpha="59.1" length="22" tooSmall="False" monospace="0.0">(a) MaximizeP(p1...pn)</doubt><doubt alpha="61.5" length="26" tooSmall="False" monospace="0.0">(b) Maximizelog2P(p1...pn)</doubt><doubt alpha="59.3" length="27" tooSmall="False" monospace="0.0">(c) Minimize—log2P(p1...pn)</doubt><doubt alpha="57.6" length="33" tooSmall="False" monospace="0.0">(d) Minimize    —log2[P(p1|START)</doubt><footnote label="3">Strictly speaking, this constraint over nodes still allows multiple decipherment paths to be active, but we can rely on the rest of our integer program to select only one.</footnote><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">814</doubt><page local="4" global="815"/><p>subject to:</p><doubt alpha="30.0" length="10" tooSmall="False" monospace="0.0">•P(p2| p1)</doubt><doubt alpha="45.5" length="11" tooSmall="False" monospace="0.0">•P(pn|pn-1)</doubt><doubt alpha="54.5" length="11" tooSmall="False" monospace="0.0">•P(END|pn)]</doubt><p>(e) Minimize   <i>—log</i><b>2 </b><i>P(p</i><b>1 </b>| <i>START)</i></p><doubt alpha="42.9" length="14" tooSmall="False" monospace="0.0">—log2P(p2| p1)</doubt><doubt alpha="58.6" length="29" tooSmall="False" monospace="0.0">—log2P(pn|pn-1)—log2P(END|pn)</doubt><p>We can guarantee this last outcome if we con­struct our minimization function as a sum of 27 • 27 • <i>(n</i><i> </i><i>— </i>1) terms, each of which is a <i>linkXYZ </i>variable multiplied by <i>—log</i><b>2</b><i>P(Z|Y </i>):</p><doubt alpha="65.7" length="67" tooSmall="False" monospace="0.0">Minimizelink1aa•—log2P(a|a)+link1ab•—log2P(b|a)+link1ac•—log2P(c|a)</doubt><p>+<i>...</i></p><doubt alpha="60.0" length="20" tooSmall="False" monospace="0.0">+link5qU•—log2P(u|q)</doubt><p>When we assign value 1 to link variables along some decipherment path, and 0 to all others, this function computes the negative log probability of that path.</p><p>We must still add a few more "subject to" con­straints. We need to ensure that the chosen path im­itates the repetition pattern of the ciphertext. While the bold path in Figure 1 represents the fine plain­text choice "decade", the dotted path represents the choice "ababab", which is not consistent with the repetition pattern of the cipher "QWBSQW". To make sure our substitutions obey a consistent key, we set up 27 • 27 = 729 new <i>keyxy </i>variables to represent the choice of key. These new variables are also binary, taking on values 0 or 1. If variable <i>key</i><i>aQ </i>= 1, that means the key maps plaintext <i>a </i>to ciphertext <i>Q. </i>Clearly, not all assignments to these 729 variables represent valid keys, so we augment the "subject to" part of our integer program by re­quiring that for any letter <i>x,</i></p><doubt alpha="63.3" length="60" tooSmall="False" monospace="0.0">keyxA+keyxB+...+keyxz+keyx_= 1keyAx+keyBx+...+keyzx+key_x= 1</doubt><p>That is, every plaintext letter must map to exactly one ciphertext letter, and every ciphertext letter must map to exactly one plaintext letter. We also add a constraint to ensure that the ciphertext space charac­ter maps to the plaintext space character:</p><doubt alpha="37.5" length="8" tooSmall="False" monospace="0.0">key__= 1</doubt><p>Finally, we ensure that any chosen decipherment path of <i>linkXYZ </i>variables is consistent with the chosen key. We know that for every node <i>A </i>along the decipherment path, exactly one active link has <i>A </i>as its destination. For all other nodes, zero active links lead in. Suppose node <i>A </i>represents the de­cipherment of ciphertext letter <i>c</i><i>i </i>as plaintext letter <i>p</i><i>j</i>—for all such nodes, we stipulate that the sum of values for <i>link(i-1)xpj </i>(for all x) equals the value of <i>keyPj</i><i>C</i><i>i</i>. In other words, whether a node lies along the chosen decipherment path or not, the chosen key must support that decision.</p><p>Figure 2 summarizes the integer program that we construct from a given ciphertext <i>c1...cn. </i>The com­puter code that transforms any given cipher into a corresponding integer program runs to about one page. Variations on the decipherment network yield 1-gram and 3-gram decipherment capabilities. Once an integer program is generated by machine, we ask the commercially-available <i>CPLEX </i>software to solve it, and then we note which <i>key</i><i>XY </i>variables are assigned value 1. Because <i>CP LEX </i>computes the optimal key, the method is not fast—for ciphers of length 32, the number of variables and constraints encoded in the integer program (IP) along with aver­age running times are shown below. It is possible to obtain less-than-optimal keys faster by interrupting the solver.</p></section><section number="4" title="Decipherment Experiments"><p>We create 50 ciphers each of lengths 2, 4, 8, ... , 256. We solve these with 1-gram, 2-gram, and 3-gram language models. We record the average percentage of ciphertext tokens decoded incorrectly. 50% error means half of the ciphertext tokens are deciphered wrong, while 0% means perfect decipherment. Here<page local="5" global="816"/></p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">815</doubt><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>Model</b></p></td><td class="cell"><p><b>#ofIP</b></p></td><td class="cell"><p><b>#ofIP</b></p></td><td class="cell"><p><b>Average</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p><b>variables</b></p></td><td class="cell"><p><b>constraints</b></p></td><td class="cell"><p><b>running time</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>1-gram</p></td><td class="cell"><p>1, 755</p></td><td class="cell"><p>1, 083</p></td><td class="cell"><p>0.01 seconds</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>2-gram</p></td><td class="cell"><p>27, 700</p></td><td class="cell"><p>2, 054</p></td><td class="cell"><p>50 seconds</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>3-gram</p></td><td class="cell"><p>211, 600</p></td><td class="cell"><p>27, 326</p></td><td class="cell"><p>450 seconds</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><p><b>variables:</b></p><p><i>linkipr </i>1 if the ith cipher letter is deciphered as plaintext letter p AND the <i>(i+1)th </i>cipher letter is deciphered as plaintext letter r 0 otherwise</p><p><i>keypq </i>1 if decipherment key maps plaintext letter p to ciphertext letter q 0 otherwise <b>minimize:</b></p><p>S<b>iU</b><b> </b><i>J2</i><i>pr linkipr </i><i>■ -log p(r\p) </i><b>subject to:</b></p><doubt alpha="63.0" length="46" tooSmall="False" monospace="0.0">for all p:rkeypr= 1for all p:rkeyrp= 1 key__=1</doubt><p>(2-gram probability of chosen plaintext) (each plaintext letter maps to exactly one ciphertext letter) (each ciphertext letter maps to exactly one plaintext letter) (cipher space character maps to plain space character) for <i>(i=1.</i><i>..n-1), </i>for all p:     r <i>linkirp = keypci+1 </i>(chosen links are consistent with chosen key)</p><doubt alpha="64.8" length="91" tooSmall="False" monospace="0.0">for(i=1...n-2),for all r: [plinkipr=^2,pHnk(i+i)rp](chosen links form a left-to-right path)</doubt><p>Figure 2: Summary of how to build an integer program for any given ciphertext <i>c\...cn. </i>Solving the integer program will yield the decipherment of highest probability.</p><p>we illustrate some automatic decipherments with er­ror rates:</p><p><b>42% error: </b>the avelage ongrichman hal cy wiof a sevesonme qus antizexty that he buprk lathes we blung than soment - fotes mmasthes <b>11% error:</b><b> </b>the average englishman has so week a reference for antiality that he would rather be prong than recent - deter quarteur <b>2% error:</b><b> </b>the average englishman has so keep a reference for antiquity that he would rather be wrong than recent - peter mcarthur <b>0% error:</b><b> </b>the average englishman has so deep a reverence for antiquity that he would rather be wrong than recent - peter mcarthur</p><p>Figure 3 shows our automatic decipherment re­sults. We note that the solution method is exact, not heuristic, so that decipherment error is not due to search error. Our use of global key constraints also leads to accuracy that is superior to (Knight et al., 2006). With a 2-gram model, their EM algorithm gives 10% error for a 414-letter cipher, while our method provides a solution with only 0.5% error. At shorter cipher lengths, we observe much higher improvements when using our method. For exam-</p><doubt alpha="100.0" length="1" tooSmall="True" monospace="0.0">o</doubt><doubt alpha="100.0" length="2" tooSmall="True" monospace="0.0">LÜ</doubt><doubt alpha="50.0" length="4" tooSmall="True" monospace="0.0">E a5</doubt><doubt alpha="62.5" length="8" tooSmall="True" monospace="0.0">Q-O OJ Q</doubt><doubt alpha="21.1" length="90" tooSmall="True" monospace="0.0">2       4       8      16     32     64     128    256    512 1024 Cipher Length (letters)</doubt><p>Figure 3: Average decipherment error using integer pro­gramming vs. cipher length, for 1-gram, 2-gram and 3-gram models of English. Error bars indicate 95% confi­dence intervals.</p><p>ple, on a 52-letter textbook cipher, using a 2-gram model, the solution from our method resulted in 21% error as compared to 85% error given by the EM so­lution.</p><p>We see that deciphering with 3-grams works well on ciphers of length 64 or more.   This confirms that such ciphers can be attacked with very limited knowledge of English (no words or grammar) and little custom programming.<page local="6" global="817"/></p><doubt alpha="0.0" length="3" tooSmall="True" monospace="0.0">100</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">90</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">80</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">70</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">60</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">50</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">40</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">30</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">20</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">10</doubt><doubt alpha="0.0" length="1" tooSmall="True" monospace="0.0">0</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">816</doubt><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><i>- p-</i></p></td><td class="cell"><p><b>1       1       </b>1       1 <b>1</b></p></td><td class="cell"><p>1       1 1</p><p>1- gram i ■ i</p><p>2- gram <b>s-h</b></p><p>3- gram .</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>- I</b></p></td><td class="cell"><p><b>r"H:--i</b></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>-</b></p></td><td class="cell"><p><b><i>X \</i></b></p></td><td class="cell"><p><b>-</b></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p><i>9</i></p><p>1       1       1       1 1</p></td><td class="cell"><p><footnote anchor="1"/> *ù <footnote anchor="1"/></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><p>The 1-gram model works badly in this scenario, which is consistent with Bauer's (2006) observation that for short texts, mechanical decryption on the ba­sis of individual letter frequencies does not work. If we had infinite amounts of ciphertext and plaintext drawn from the same stochastic source, we would expect the plain and cipher frequencies to eventually line up, allowing us to read off a correct key from the frequency tables. The upper curve in Figure 3 shows that convergence to this end is slow.</p></section><section number="5" title="Shannon Equivocation and Unicity Distance"><p>Very short ciphers are hard to solve accurately. Shannon (1949) pinpointed an inherent difficulty with short ciphers, one that is independent of the so­lution method or language model used; the cipher itself may not contain enough information for its proper solution. For example, given a short cipher like XYYX, we can never be sure if the answer is <i>peep, noon, anna, </i>etc. Shannon defined a mathemat­ical measure of our decipherment uncertainty, which he called <i>equivocation </i>(now called entropy).</p><p>Let C be a cipher, M be the plaintext message it encodes, and K be the key by which the encoding takes place. Before even seeing <i>C,</i><i> </i>we can compute our uncertainty about the key <i>K </i>by noting that there are 26! equiprobable keys:<footnote anchor="4"/></p><doubt alpha="18.5" length="54" tooSmall="False" monospace="0.0">H(K)   =   -(26!) • (1/26!) •logs(1/26!) =   88.4 bits</doubt><p>That is, any secret key can be revealed in 89 bits. When we actually receive a cipher C, our uncer­tainty about the key and the plaintext message is re­duced. Shannon described our uncertainty about the plaintext message, letting m range over all decipher­ments:</p><p>H(M|C)   =    equivocation of plaintext message</p><p>P(m|C) is probability of plaintext m (according to the language model) divided by the sum ofproba-bilities of all plaintext messages that obey the repeti­tion pattern of <i>C. </i>While integer programming gives us a method to find the most probable decipherment without enumerating all keys, we do not know of a similar method to compute a full equivocation with­out enumerating all keys. Therefore, we sample up to 100,000 plaintext messages in the neighborhood of the most probably decipherment<footnote anchor="5"/> and compute <i>H</i><i> </i><i>(M</i><i> </i><i>I</i><i>C</i><i> </i><i>)</i><i> </i>over that subset.<footnote anchor="6"/></p><p>Shannon also described H(K|C), the <i>equivoca­tion of key. </i>This uncertainty is typically larger than H (M |C ), because a given message M may be de­rived from C via more than one key, in case C does not contain all 26 letters of the alphabet.</p><p>We compute H (K |C) by letting <i>r(C) </i>be the number of distinct letters in C, and letting <i>q(C) </i>be (26 — r(C))!. Letting i range over our sample of plaintext messages, we get:</p><doubt alpha="60.6" length="33" tooSmall="False" monospace="0.0">H(K|C)   =    equivocation of key</doubt><doubt alpha="39.4" length="33" tooSmall="False" monospace="0.0">=   -Ç) •(PWMC)) •logs(P(i)/q(C))</doubt><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">i</doubt><doubt alpha="40.0" length="25" tooSmall="False" monospace="0.0">=-]TP(i) •log2(P(i)/q(C))</doubt><doubt alpha="41.9" length="31" tooSmall="False" monospace="0.0">= -p(i) • (log2p(i) - logsq(c))</doubt><doubt alpha="54.5" length="33" tooSmall="False" monospace="0.0">=-Zp(i) • logspM+Zp(i) • logsq(c)</doubt><doubt alpha="100.0" length="2" tooSmall="False" monospace="0.0">ii</doubt><doubt alpha="36.0" length="25" tooSmall="False" monospace="0.0">=    H (M |C ) + logsq(C)</doubt><p>Shannon (1949) used analytic means to roughly sketchthe curves forH(K|C) and H(M|C), which we reproduce in Figure 4. Shannon's curve is drawn for a human-level language model, and the y-axis is given in "decimal digits" instead of bits.</p><doubt alpha="50.0" length="20" tooSmall="False" monospace="0.0">=P(m|C ) •logsP(m|C)</doubt><footnote label="4">(Shannon, 1948) The entropy associated with a set of pos­sible events whose probabilities of occurrence are p i , p s ,p n is given by H = -J2 n i=i Pi • log s (p i).</footnote><footnote label="5">The sampling used to compute H (M |C) starts with the optimal key and expands out a frontier, by swapping letters in the key, and recursing to generate new keys (and corresponding plaintext message decipherments). The plaintext messages are remembered so that the frontier expands efficiently. The sam­pling stops if 100,000 different messages are found.</footnote><footnote label="6">Interestingly, as we grow our sample out from the most probable plaintext, we do not guarantee that any intermediate result is a lower bound on the equivocation. An example is pro­vided by the growing sample (0.12, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01), whose entropy steadily increases. However, if we add a 14th item whose P(m) is 0.12, the entropy suddenly decreases from 2.79 to 2.78.</footnote><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">817</doubt><page local="7" global="818"/><doubt alpha="100.0" length="1" tooSmall="True" monospace="0.0">o</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">90</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">80</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">70</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">60</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">50</doubt><doubt alpha="0.0" length="2" tooSmall="True" monospace="0.0">40</doubt><doubt alpha="0.0" length="1" tooSmall="True" monospace="0.0">0</doubt><doubt alpha="66.7" length="12" tooSmall="True" monospace="0.0">N (LE TTCRS)</doubt><figure caption="Figure 4: Equivocation for simple substitution on English (Shannon, 1949)."></figure><doubt alpha="50.0" length="8" tooSmall="True" monospace="0.0">"t/T IQ,</doubt><doubt alpha="66.7" length="3" tooSmall="True" monospace="0.0">"rö</doubt><doubt alpha="33.3" length="3" tooSmall="True" monospace="0.0">o &gt;</doubt><doubt alpha="100.0" length="4" tooSmall="True" monospace="0.0">crlu</doubt><doubt alpha="57.1" length="7" tooSmall="True" monospace="0.0">1- gram</doubt><doubt alpha="57.1" length="7" tooSmall="True" monospace="0.0">2- gram</doubt><doubt alpha="57.1" length="7" tooSmall="True" monospace="0.0">3- gram</doubt><doubt alpha="33.3" length="3" tooSmall="True" monospace="0.0">I5_</doubt><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">75</doubt><doubt alpha="40.0" length="5" tooSmall="True" monospace="0.0">ü o &gt;</doubt><doubt alpha="100.0" length="4" tooSmall="True" monospace="0.0">crLU</doubt><doubt alpha="92.3" length="13" tooSmall="True" monospace="0.0">Cipher Length</doubt><p>Figure 5: Average key equivocation observed (bits) vs. Figure 6: Average message equivocation observed (bits) cipher length (letters), for 1-gram, 2-gram and 3-gram vs. cipher length (letters), for 1-gram, 2-gram and 3-gram models of English. models of English.</p><doubt alpha="91.7" length="12" tooSmall="True" monospace="0.0">egitstfl tfl</doubt><doubt alpha="100.0" length="2" tooSmall="False" monospace="0.0">OJ</doubt><doubt alpha="100.0" length="1" tooSmall="True" monospace="0.0">E</doubt><p>For comparison, we plot in Figures 5 and 6 the av­erage equivocations as we empirically observe them using our 1-, 2-, and 3-gram language models.</p><p>The shape of the key equivocation curve follows Shannon, except that it is curved from the start, rather than straight.</p><p>The message equivocation curve follows Shan­non's prediction, rising then falling. Because very short ciphers have relatively few solutions (for example, a one-letter cipher has only 26), the overall uncertainty is not that great.<footnote anchor="7"/> As the cipher gets longer, message equivocation rises. At some point, it then decreases, as the cipher begins to reveal its secret through patterns of repetition.</p><p>Shannon's analytic model also predicts a sharp decline of message equivocation towards zero. He defines the <i>unicity distance </i><i>(U</i>) as the cipher length at which we have virtually no more uncertainty about the plaintext.<page local="8" global="819"/> Using analytic means (and vari­ous approximations), he gives:</p><footnote label="7">Uncertainty is only loosely related to accuracy—even if we are quite certain about a solution, it may still be wrong.</footnote><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">818</doubt><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>1 <b>1</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>K</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>—*■</p></td><td class="cell"><p></p></td><td class="cell"><p><b>s</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>m1«</p></td><td class="cell"><p>Key Equivocation</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>1</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>1</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>1</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>-</p></td><td class="cell"><p>Vlessage Equivocation</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>1 </b><b>J—</b></p></td><td class="cell"><p><b><footnote anchor="1"/> / <footnote anchor="1"/> '-</b></p><p><b>—;—^/ Mr;uj i</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><i>i</i></p></td><td class="cell"><p><i>~i ■</i></p></td><td class="cell"><p><b>j-</b>— <b>i ■</b></p></td><td class="cell"><p></p></td><td class="cell"><p><i>_à,</i></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>! LT-</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>Unicity Distance</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p>1 <footnote anchor="1"/></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>rn</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>rn</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>rn</b></p></td><td class="cell"><p><b>rn</b></p></td><td class="cell"><p><b>rn</b></p></td><td class="cell"><p><b>rn</b></p></td><td class="cell"><p></p></td><td class="cell"><p>1  <b>1  </b>1  1  <b>1 </b>1</p><p>1- gram —*—</p><p>2- gram —□—</p><p>3- gram -------</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>&gt;£-</p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>—*</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p><b>'</b></p></td><td class="cell"><p></p></td><td class="cell"><p><b>'—</b></p></td><td class="cell"><p><b>—</b></p></td><td class="cell"><p><b>—</b></p></td><td class="cell"><p><b>—</b></p></td><td class="cell"><p><b>—</b></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>■</p><p><b>lj</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>3—</b></p><p><b>»-</b></p><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>■B-</b></p><p><b>1_1</b></p></td><td class="cell"><p><b>_</b></p></td><td class="cell"><p></p></td><td class="cell"><p><b>l</b><b>_3</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>--E</b></p><p><b>_</b></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_l</b></p></td><td class="cell"><p><b>_i</b></p></td><td class="cell"><p><b>_</b></p></td><td class="cell"><p><b>_i</b></p></td><td class="cell"><p><b>_i</b></p></td><td class="cell"><p><b>_i</b></p></td><td class="cell"><p>_j</p></td><td class="cell"><p></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><doubt alpha="56.2" length="16" tooSmall="False" monospace="0.0">U=H(K- B) where:</doubt><doubt alpha="63.0" length="46" tooSmall="False" monospace="0.0">A = bits per character of a 0-gram model (4.7)</doubt><p>B = bits per character of the model used to decipher</p><p>For a human-level language model (B ~ 1.2), he concludes U ~ 25, which is confirmed by practice. For our language models, the formula gives:</p><doubt alpha="30.6" length="49" tooSmall="False" monospace="0.0">U = 173 (1-gram)U=74(2-gram) U   =    50 (3-gram)</doubt><p>These numbers are in the same ballpark as Bauer (2006), who gives 167, 74, and 59. We note that these predicted unicity distances are a bit too rosy, according to our empirical message equivoca­tion curves. Our experience confirms this as well, as 1-gram frequency counts over a 173-letter cipher are generally insufficient to pin down a solution.</p></section><section number="6" title="Conclusion"><p>We provide a method for deciphering letter substi­tution ciphers with low-order models of English. This method, based on integer programming, re­quires very little coding and can perform an opti­mal search over the key space. We conclude by not­ing that English language models currently used in speech recognition (Chelba and Jelinek, 1999) and automated language translation (Brants et al., 2007) are much more powerful, employing, for example, 7-gram word models (not letter models) trained on trillions of words. Obtaining optimal keys accord­ing to such models will permit the automatic deci­pherment of shorter ciphers, but this requires more specialized search than what is provided by gen­eral integer programming solvers. Methods such as these should also be useful for natural language decipherment problems such as character code con­version, phonetic decipherment, and word substitu­tion ciphers with applications in machine translation (Knight et al., 2006).</p></section><section number="7" title="Acknowledgements"><p>The authors wish to gratefully acknowledge Jonathan Graehl, for providing a proof to support the argument that taking a larger number of samples does not necessarily increase the equivocation. This research was supported by the Defense Advanced Research Projects Agency under SRI International's prime Contract Number NBCHD040058.</p></section><references><p>Friedrich L. Bauer. 2006. <i>Decrypted Secrets: Methods and Maxims ofCryptology. </i>Springer-Verlag.</p><p>Thorsten Brants, Ashok C. Popat, Peng Xu, Franz J. Och, and Jeffrey Dean. 2007. Large language mod­els in machine translation. In <i>Proceedings ofEMNLP-CoNLL.</i></p><p>Ciprian Chelba and Frederick Jelinek. 1999. Structured language modeling for speech recognition. In <i>Pro­</i><i>ceedings of NLDB: 4th International Conference on Applications ofNatural Language to Information Sys­tems.</i></p><p>Ravi Ganesan and Alan T. Sherman. 1993. Statistical techniques for language recognition: An introduction and guide for cryptanalysts. <i>Cryptologia, </i>17(4):321366.</p><p>David Graff and Rebecca Finch. 1994. Multilingual text resources at the linguistic data consortium. In <i>Pro­</i><i>ceedings ofthe HLT Workshop on Human Language Technology.</i></p><p>Thomas Jakobsen. 1995. A fast method for cryptanalysis of substitution ciphers. <i>Cryptologia, </i>19(3):265-274.</p><p>Kevin Knight, Anish Nair, Nishit Rathod, and Kenji Ya-mada. 2006. Unsupervised analysis for decipherment problems. In <i>Proceedings ofthe COLING/ACL.</i></p><p>Edwin Olson. 2007. Robust dictionary attack of short simple substitution ciphers. <i>Cryptologia, </i>31(4):332342.</p><p>Shmuel Peleg and Azriel Rosenfeld. 1979. Break­ing substitution ciphers using a relaxation algorithm. <i>Comm. ACM, </i>22(11):598-605.</p><p>Alexander Schrijver. 1998. <i>Theory of Linear and Integer Programming. </i>John Wiley &amp; Sons.</p><p>Claude E. Shannon. 1948. A mathematical theory of communication. <i>Bell System Technical Journal, </i>27:379-423 and 623-656.</p><p>Claude E. Shannon. 1949. Communication theory of secrecy systems.  <i>Bell System Technical Journal,</i> 28:656-715.</p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">819</doubt></references></body></article>