11 "import matplotlib.pyplot as plt\n",
12 "%matplotlib inline\n",
14 "from cipherbreak import *\n",
16 "c8a = sanitise(open('2015/8a.ciphertext').read())\n",
17 "c8b = sanitise(open('2015/8b.ciphertext').read())"
22 "execution_count": 12,
30 "('charlie', -2104.8140749325567)"
33 "execution_count": 12,
35 "output_type": "execute_result"
39 "key_a, score = vigenere_frequency_break(c8a)\n",
45 "execution_count": 15,
52 "output_type": "stream",
54 "harry i am so sorry we went into the russian hq last night without you but the station chief wanted it to be his team that got the glory i am really grateful to you for coming back and putting us on the right track though the stolen file from soviet headquarters was as you expected encrypted with the solitaire cipher fortunately the cipher clerk who managed the encryption was incredibly careless i found a sheet of burnt paper in the bin which gave me a list of thirty eight cards and i am hoping that this is a large part of the key it will still be hard to break but maybe not impossible especially as the erased part was still intact there maybe another clue in that the page appears to have been torn from an economics textbook i found on the desk anyway i figure the chemists at langley may help us to reconstruct the whole key given time though i wouldnt expect them to manage more than one card a day given how careful they will have to be not to destroy the document it will take usa while to crack this but maybe time is on our side with christmas things seem to be quiet and i am hoping that within the next three weeks we may know precisely what the soviets were trying to do here whatever the outcome i think it is clear that the future of europe is not likely to be settled for a while i hear rumours everyday about shortages in the soviet bloc and border controls are going up in places you wouldnt expect to prevent largescale migration there are problems in greece and turkey and divisions between the british and french and the brits are having real trouble paying off their war debts whether or not we crack the reichs doktor mystery i think there is going to be plenty for you to do i know we had to work hard to persuade you to flyover but we really do need you here even the chief recognizes that so if i can i want to persuade you to stay francois and i are being posted to paris kind of a thankyou for our work on this project but icant go unless i know the berlin station has someone i trust hope youll agree to take the job charlie\n"
59 "print(' '.join(segment(vigenere_decipher(c8a, key_a))))"
64 "execution_count": null,
74 "display_name": "Python 3",
83 "file_extension": ".py",
84 "mimetype": "text/x-python",
86 "nbconvert_exporter": "python",
87 "pygments_lexer": "ipython3",