11 "import matplotlib.pyplot as plt\n",
12 "%matplotlib inline\n",
14 "from cipherbreak import *\n",
16 "c5a = open('2015/5a.ciphertext').read()\n",
17 "c5b = open('2015/5b.ciphertext').read()"
30 "(('cornfield', <KeywordWrapAlphabet.from_largest: 3>), -1557.5551917175146)"
35 "output_type": "execute_result"
39 "(key_a_word, key_a_wrap), score = keyword_break_mp(c5a)\n",
40 "(key_a_word, key_a_wrap), score"
52 "output_type": "stream",
54 "harry, i checked out who transcribed the radio transmission like you asked. it was a junior cipher clerk in room 5. i would have offered to set up a meeting with her, but she has disappeared and hasn’t been seen since last friday. the marines saw her leave at her usual time, and she was booked out for some leave on monday and tuesday so no one noticed she was missing until today. we sent an officer out to her usual haunts and i will get back to you if we find anything. what made you ask? did you have a reason to believe she was involved in something? \n",
56 "i took another look at the messages. were you referring to the typos? the word ratlines keeps being spelt as ratilines. is that important? what did you mean about our source being close to home? \n",
58 "also did some digging about the reichsdoktor. seems you were right and it refers to an underground nazi organisation dedicated to rebuilding the reich. maybe they think of it as healing? a bunch of rich nazi sympathisers took over the ratlines from a group of ss officers who set them up at the tail of the war and have been active in shipping scientists, engineers and soldiers to towns across south america. if our source has inside information then maybe we could intercept the lines and pick up some of the high value targets the french are after. what was “die alchemisten project”? \n",
60 "the enclosed message was handed to the marines, but they didn’t get a name. initial analysis shows it must be a vigenere cipher with period two so it should be reasonably straightforward to crack. \n",
62 "all the best, charlie \n",
68 "print(keyword_decipher(c5a, key_a_word, wrap_alphabet=key_a_wrap))"
73 "execution_count": 10,
81 "('de', -885.6842458313828)"
84 "execution_count": 10,
86 "output_type": "execute_result"
90 "key_b, score = vigenere_frequency_break(c5b, max_key_length=2)\n",
96 "execution_count": 21,
103 "output_type": "stream",
105 "the first item in our little auction will be the location of a safehouse in the uk sector of berlin it is a minor stopover on the rat lines but you never know you might get lucky and find someone interesting hiding there at the very least you will inconvenience the reichs doktor if you take possession of it how much would that be worth to you do i hear a bid of five hundred thousand francs from our french friends perhaps the british would pay more or maybe they can not afford to i wonder how they feel about that perhaps you should ask them if you want to outbid your so called friends then leave the money in unmarked treasury bills in locker at the far end of the platform in friedrichstrasse i will leave the details in locker you will find the key in do not try to double cross me it will not work and our little game will end before it has even properly begun\n"
110 "print(' '.join(segment(sanitise(vigenere_decipher(sanitise(c4b), key_b)))))"
115 "execution_count": null,
125 "display_name": "Python 3",
126 "language": "python",
134 "file_extension": ".py",
135 "mimetype": "text/x-python",
137 "nbconvert_exporter": "python",
138 "pygments_lexer": "ipython3",