11 "import matplotlib.pyplot as plt\n",
12 "%matplotlib inline\n",
14 "from cipherbreak import *\n",
16 "c2a = open('2015/2a.ciphertext').read()\n",
17 "c2b = open('2015/2b.ciphertext').read()"
30 "(15, -1150.5844346071483)"
35 "output_type": "execute_result"
39 "key_a, score = caesar_break(c2a)\n",
52 "output_type": "stream",
54 "CHARLIE, NO NEED TO APOLOGISE, LIFE WAS GETTING DULL BEHIND A DESK AND I WAS GLAD TO HAVE AN EXCUSE TO FLY BACK TO EUROPE. I AM INTRIGUED ABOUT THE REICHSDOKTOR - I HADN'T COME ACROSS THIS BEFORE, WHEN DID YOU FIRST COME HEAR OF IT? \n",
55 "I THINK I MAY ALREADY BE MAKING SOME PROGRESS. ON ARRIVAL I FOUND A POSTCARD WAITING FOR ME ON THE MAT AT THE EMBASSY WITH NO MESSAGE ON IT . AT LEAST THAT'S WHAT IT LOOKED LIKE AT FIRST. I DID NOTICE THAT THE LETTERS ON THE FRONT COULD BE HIGHLIGHTED TO PICK OUT THE PHRASE THE REICHSDOKTOR SO UNLESS THAT IS AN EXTRAORDINARY COINCIDENCE I FIGURED IT MUST BE RELATED TO OUR INVESTIGATION. THE STRANGEST THING WAS THAT THE POSTCARD HAD A STAMP BUT NO POSTMARK ON IT, SO IT CAN'T HAVE BEEN POSTED. SINCE IT WASN'T SIGNED I ASSUME THEY WANTED TO STAY ANONYMOUS AND I COULDN'T SEE WHY THEY WOULD HAVE TAKEN THE RISK OF HAND DELIVERING IT, BUT IN THE END I WORKED IT OUT. THERE WAS A HIDDEN MESSAGE. I'LL LEAVE IT TO YOU TO FIGURE OUT WHERE IT WAS HIDDEN. ANYWAY I'VE ATTACHED THE MESSAGE I FOUND. I KNOW THAT RELATIONS WITH THREE OF THE FOUR POWERS ARE RELATIVELY STABLE, BUT I THINK WE NEED TO KEEP THIS TO OURSELVES FOR NOW. ALL THE BEST, \n",
62 "print(caesar_decipher(c2a, key_a))"
75 "(21, -574.2402792119872)"
80 "output_type": "execute_result"
84 "key_b, score = caesar_break(c2b)\n",
97 "output_type": "stream",
99 "if you really want to get in the middle of this you will have to pay i know you will be hunting me and i can forgive the arrogance but i will not forgive your ignorance before you can learn more about the rat lines from me you will have to ask your colleagues in french and british intelligence what they already know powerful forces are working to keep the rat lines running and we both need to know who our enemies are before we can meet you should understand that without me your investigations will gain little negotiations with me may gain everything\n"
104 "print(' '.join(segment(sanitise(caesar_decipher(c2b, key_b)))))"
109 "execution_count": null,
119 "display_name": "Python 3",
120 "language": "python",
128 "file_extension": ".py",
129 "mimetype": "text/x-python",
131 "nbconvert_exporter": "python",
132 "pygments_lexer": "ipython3",