Resigned
[cipher-training.git] / 2014-challenge5.ipynb
1 {
2 "metadata": {
3 "name": "",
4 "signature": "sha256:7aee1c5a7be0ded7315a453bbefef56aee8217ed72fa1276cfe88f18bc828f77"
5 },
6 "nbformat": 3,
7 "nbformat_minor": 0,
8 "worksheets": [
9 {
10 "cells": [
11 {
12 "cell_type": "code",
13 "collapsed": false,
14 "input": [
15 "import matplotlib.pyplot as plt\n",
16 "import pandas as pd\n",
17 "import collections\n",
18 "import string\n",
19 "%matplotlib inline\n",
20 "\n",
21 "from cipherbreak import *\n",
22 "\n",
23 "c5a = open('2014/5a.ciphertext').read()\n",
24 "c5b = open('2014/5b.ciphertext').read()"
25 ],
26 "language": "python",
27 "metadata": {},
28 "outputs": [],
29 "prompt_number": 1
30 },
31 {
32 "cell_type": "code",
33 "collapsed": false,
34 "input": [
35 "freqs = pd.Series(english_counts)\n",
36 "freqs.plot(kind='bar')"
37 ],
38 "language": "python",
39 "metadata": {},
40 "outputs": [
41 {
42 "metadata": {},
43 "output_type": "pyout",
44 "prompt_number": 2,
45 "text": [
46 "<matplotlib.axes.AxesSubplot at 0x7fde5b682550>"
47 ]
48 },
49 {
50 "metadata": {},
51 "output_type": "display_data",
52 "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD+CAYAAAA+hqL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX+0VeV55z9XKZjoxcs1FsEYr7U0SrVhQojpSuI6/kBp\nJkGcWsWZCjczk1VljHFNp4NkpgOMq5TQ1anamTQmGi40wWiro5gRBIGdmh94lXgMkSBgggUqJAYR\nTFIGRuaP5z2cfc89P/be95593vPe72etvfa73/0++/2x99nPfp/vPueAEEIIIYQQQgghhBBCCCGE\nEEIIIYQQQgghhBAtZQHwMrAVWAWMAbqB9cAOYB3QVVF+J7AduCaWP9UdYydwbyx/DPCwy98MnB/b\nN9fVsQOYM1wdEkIIkZ0e4MfYzRvsBj4XWAb8Z5c3H1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kK9kT+Y9emrdiDSS1KD09LsRAp1L6+bnPH+2Xs\n2Fuxl/i/3qBdlXRjN9YkfAC7Eb8CbEhQfhQ2vp8H/pHGY3Y6NovbjDmJz5MsanMK5hS+gfVlCXBh\nnfIvurZ9EXgS6CKlYxjVuEhbsQebdj2OefI3qf2NkNIHbBT2BLgHi0W+j/on+C+B72EevAP4A+xi\nqsdKTBt4zNnMwp646vHX2Gzn17EL4Qbgv9Yoe59bvoSFAdLwdcwJPe7a9ilgFXYRVzrV0pidCnwa\nczxHXV6jGHszqbxZdmMfpudoTrvmYg5oFPa9mhKP1bH5OOnHbDnWh/h1UytsWeJDVL+et9apL8v1\neW2D/ZXsw5zjdMw5nEbtm+IqLFS1lPITNliY7+cN6olfC6dgn5+k+sJPgf2ujrMblN2AfUa+h800\nPuTs63Ec+BXm4E/DnOo7dS2Md1y7DmDOeBzw98AzwJ/UqWse0IvN/lKFo0IUn0sUsJjmWuD/Vtnf\nU8f2BPBanf2/jU0lT2DxvEazErA4bklE/AeSefCLgatcegO1QztDZRoW1z+B3VReqFGup8Fxdg9f\nk1LR02D/7mGu7xUsXJXmm/k9NfJ3N7CbykAhudF1U6ueRvVluT7TcDr21PsD7JeSJ2B60Lphrqcn\nlj6O3UyPNbCZh2kgvw78HfAwjT/Tf4U5g38GvouFq76H3fhr8RKwGnNU7wHuxx4S/qCOzeeAOZiz\negB7WDyGOb2dVJ85/JE7dompwH8A/m2DPgkhhsBy7OFAhMGfk/0bwJ3AZ7EHyaMNyk6rkjengc1i\n4Pwa+6qJ2cNCyDMGIZrFduxJzZdQmsifz2IzrKnYdfCsWza2slHDRWgagxB5MKNxERE4p2F64/dp\nHKoSQgghhBBCCCGEEEIIIYQQQgghhBBCiBHO/wdc3dBPs9bnrQAAAABJRU5ErkJggg==\n",
53 "text": [
54 "<matplotlib.figure.Figure at 0x7fde6c503908>"
55 ]
56 }
57 ],
58 "prompt_number": 2
59 },
60 {
61 "cell_type": "code",
62 "collapsed": false,
63 "input": [
64 "c5bs = sanitise(c5b)\n",
65 "c5bs"
66 ],
67 "language": "python",
68 "metadata": {},
69 "outputs": [
70 {
71 "metadata": {},
72 "output_type": "pyout",
73 "prompt_number": 3,
74 "text": [
75 "'sssatanuelclaendeeheevrnhtailsltocsoeoanuodoeecaferbetrtenoiiucrwurfaproeercssoeuatulgtematremlieaveieogcelesaeeeyyiuuoaidaosdmdecsshthuhatcnxaererseltunaghanrdtevepisydtaeamcinmrnweoramrvibodsdfdpatimrssietdaospecgracnetblfioeushsmeeirlshmittrlnesehmclssoswfottwnbyteyngeymttgstariixeeedrnasmltwgmildcrtseogohrolsshmawndsstrabndnecfcayehotdornonenecatneavoeaatehercyrighsayrefsooatemncwtkaaawndadmsllnnnlutfoeeenoyoewtmanrrsxhvorolhisfunnthaeeofolphebaatmnornoeodnvtphnoetedeaeonphpaeuratvhndetahrahpoorsefovddsttpsvgraaatodsuryidovtrelerltmemdheoarshoarrrerxisgeifawfaiyidusiyieeesotkeaelatresntifemteiaighaceiondktkitteaeanecnndictnedddenstsheanrtamneahshidaocnuissctehslnlectheetlltidlcttnpnmcvsvnositdaelxpihsfattysfoedcmwhtebaachertaigriuirtngiaphetrowehwswaacmgcouwoogoegsmtarteeiemvayinogstitagblncstcycolretedarehopnebyegwcteetlteyeteenansafmo'"
76 ]
77 }
78 ],
79 "prompt_number": 3
80 },
81 {
82 "cell_type": "code",
83 "collapsed": false,
84 "input": [
85 "key_a, score = keyword_break_mp(c5a)\n",
86 "key_a, score"
87 ],
88 "language": "python",
89 "metadata": {},
90 "outputs": [
91 {
92 "metadata": {},
93 "output_type": "pyout",
94 "prompt_number": 4,
95 "text": [
96 "(('seabird', <KeywordWrapAlphabet.from_largest: 3>), -1255.0542494109186)"
97 ]
98 }
99 ],
100 "prompt_number": 4
101 },
102 {
103 "cell_type": "code",
104 "collapsed": false,
105 "input": [
106 "print(' '.join(segment(keyword_decipher(sanitise(c5a), key_a[0], key_a[1]))))"
107 ],
108 "language": "python",
109 "metadata": {},
110 "outputs": [
111 {
112 "output_type": "stream",
113 "stream": "stdout",
114 "text": [
115 "harry i cracked that last message for myself and noticed something really odd the text said it was encrypted using a column transposition with keyword seabird but it was enciphered using a rail fence cipher i can only assume that the text we retrieved was an archive of the original message re encrypted for safety whoever the flag day associates are they have a pretty sophisticated operation if they are filing messages like this more like one of the major terrorist groups than the usual hacker collective the tech guys took a look at the aerial from the boat and they tell me that it is a drag wire usually used to communicate with a submarine when submerged it carried an acoustic transducer array as well as a shortwave transmitter and listening gear one thing that puzzles me now is why we were allowed to find the ship floating at all surely they must have planned to sink her using the scuttling equipment otherwise what was it for they seem too smart to leave it floating for us to find any thoughts mark ps just before i sent this the cipher clerk came in with a decrypt of the attached columnar transposition keyword has length six think it answers some of our questions about the nautilus system\n"
116 ]
117 }
118 ],
119 "prompt_number": 5
120 },
121 {
122 "cell_type": "code",
123 "collapsed": false,
124 "input": [
125 "key_b, score = column_transposition_break_mp(c5bs)\n",
126 "key_b, score"
127 ],
128 "language": "python",
129 "metadata": {},
130 "outputs": [
131 {
132 "metadata": {},
133 "output_type": "pyout",
134 "prompt_number": 6,
135 "text": [
136 "(((3, 2, 4, 1, 5, 0), False, True), -1998.321513226948)"
137 ]
138 }
139 ],
140 "prompt_number": 6
141 },
142 {
143 "cell_type": "code",
144 "collapsed": false,
145 "input": [
146 "print(' '.join(segment(sanitise(column_transposition_decipher(sanitise(c5bs), key_b[0], \n",
147 " fillcolumnwise=key_b[1], \n",
148 " emptycolumnwise=key_b[2])))))"
149 ],
150 "language": "python",
151 "metadata": {},
152 "outputs": [
153 {
154 "output_type": "stream",
155 "stream": "stdout",
156 "text": [
157 "phase five seahorse is ready for trials and the nautilus system is fully functional we engaged the mechanism and lowered the deck to three feet above sealevel approaching the shore by the radar station at all times signals from their communications were monitored and no sign was given that our approach had been monitored or even noticed we backed off the deck was raised by two feet and the approach attempted again once more our incursion was unnoticed overnight we conducted a range of tests and mapped the radar coverage on three separate occasions there seems to have been a flurry of activity and our modeling suggests that the ships masts may have triggered brief alarms on all occasions the automatic dive systems cut incorrectly lowering the decks to sealevel and the alarms were cancelled the seahorse deployment system will be fully mounted tonight and we will conduct a battery of tests on the deployment and emergency recovery systems over the next two nights assuming that sea and air traffic remains low xxxx\n"
158 ]
159 }
160 ],
161 "prompt_number": 42
162 },
163 {
164 "cell_type": "code",
165 "collapsed": false,
166 "input": [
167 "key_b, score = column_transposition_break_mp(c5bs, fitness=Ptrigrams)\n",
168 "key_b, score"
169 ],
170 "language": "python",
171 "metadata": {},
172 "outputs": [
173 {
174 "metadata": {},
175 "output_type": "pyout",
176 "prompt_number": 8,
177 "text": [
178 "(((3, 2, 4, 1, 5, 0), False, True), -2821.4971440358026)"
179 ]
180 }
181 ],
182 "prompt_number": 8
183 },
184 {
185 "cell_type": "code",
186 "collapsed": false,
187 "input": [
188 "print(' '.join(segment(sanitise(column_transposition_decipher(c5bs, key_b[0], \n",
189 " fillcolumnwise=key_b[1], emptycolumnwise=key_b[2])))))"
190 ],
191 "language": "python",
192 "metadata": {},
193 "outputs": [
194 {
195 "output_type": "stream",
196 "stream": "stdout",
197 "text": [
198 "phase five seahorse is ready for trials and the nautilus system is fully functional we engaged the mechanism and lowered the deck to three feet above sealevel approaching the shore by the radar station at all times signals from their communications were monitored and no sign was given that our approach had been monitored or even noticed we backed off the deck was raised by two feet and the approach attempted again once more our incursion was unnoticed overnight we conducted a range of tests and mapped the radar coverage on three separate occasions there seems to have been a flurry of activity and our modeling suggests that the ships masts may have triggered brief alarms on all occasions the automatic dive systems cut incorrectly lowering the decks to sealevel and the alarms were cancelled the seahorse deployment system will be fully mounted tonight and we will conduct a battery of tests on the deployment and emergency recovery systems over the next two nights assuming that sea and air traffic remains low xxxx\n"
199 ]
200 }
201 ],
202 "prompt_number": 40
203 },
204 {
205 "cell_type": "code",
206 "collapsed": false,
207 "input": [
208 "transpositions[key_b[0]]"
209 ],
210 "language": "python",
211 "metadata": {},
212 "outputs": [
213 {
214 "metadata": {},
215 "output_type": "pyout",
216 "prompt_number": 41,
217 "text": [
218 "['tokens',\n",
219 " 'trials',\n",
220 " 'tricks',\n",
221 " 'tromps',\n",
222 " 'umiaks',\n",
223 " 'unfair',\n",
224 " 'urbans',\n",
225 " 'urgent',\n",
226 " 'vocals',\n",
227 " 'womans',\n",
228 " 'womens',\n",
229 " 'wreaks',\n",
230 " 'wrecks',\n",
231 " 'yokels',\n",
232 " 'ricardo',\n",
233 " 'sneaker',\n",
234 " 'speaker',\n",
235 " 'tobagos',\n",
236 " 'trebles',\n",
237 " 'woolens',\n",
238 " 'sneakers',\n",
239 " 'speakers',\n",
240 " 'speedier',\n",
241 " 'tobaccos',\n",
242 " 'together',\n",
243 " 'treaties',\n",
244 " 'treatise',\n",
245 " 'trollops',\n",
246 " 'unedited',\n",
247 " 'woollens',\n",
248 " 'wreckers',\n",
249 " 'treatises',\n",
250 " 'triteness',\n",
251 " 'usherette',\n",
252 " 'woodcocks',\n",
253 " 'tritenesss',\n",
254 " 'usherettes']"
255 ]
256 }
257 ],
258 "prompt_number": 41
259 },
260 {
261 "cell_type": "code",
262 "collapsed": false,
263 "input": [],
264 "language": "python",
265 "metadata": {},
266 "outputs": []
267 }
268 ],
269 "metadata": {}
270 }
271 ]
272 }