11 "import os,sys,inspect\n",
12 "currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\n",
13 "parentdir = os.path.dirname(currentdir)\n",
14 "sys.path.insert(0,parentdir) \n",
16 "import matplotlib.pyplot as plt\n",
17 "%matplotlib inline\n",
19 "from cipherbreak import *\n",
21 "c1a = open('1a.ciphertext').read()\n",
22 "c1b = open('1b.ciphertext').read()"
35 "(4, -728.156672407534)"
40 "output_type": "execute_result"
44 "key_a, score = caesar_break(c1a)\n",
57 "output_type": "stream",
61 "THANKS FOR BRINGING ME IN ON THIS ONE, SEEMS LIKE A FASCINATING CASE. \n",
63 "I HAVE THREE QUESTIONS: \n",
64 "WHY WOULD THE FLAG DAY ASSOCIATES WANT A SHIP? \n",
65 "WHY WOULD THEY WANT THIS SHIP? \n",
66 "WHY WOULD THEY WANT THIS SHIP NOW? \n",
68 "HAVING READ THE ATTACHED DOCUMENT I SUSPECT THAT THE ANSWERS ARE ALL RELATED TO THE QUESTION OF WHAT EXACTLY SHE AND HER FLAG DAY ASSOCIATE CREW WERE TRYING TO SURVEY. \n",
70 "I AM GUESSING THAT YOU ALREADY CHECKED OUT THE ONBOARD GPS SYSTEM FOR INFORMATION ABOUT HER MOVEMENTS, BUT IF YOU DID FIND ANYTHING I WOULD BE FASCINATED TO HEAR ABOUT IT. IN THE MEANTIME I AM PRETTY SURE THAT YOU KNOW MORE ABOUT THE FLAG DAY ASSOCIATES THAN YOU HAVE TOLD ME, SO A BRIEFING WOULD BE MUCH APPRECIATED. \n",
80 "print(caesar_decipher(c1a, key_a))"
93 "(22, -637.7038880633795)"
98 "output_type": "execute_result"
102 "key_b, score = caesar_break(c1b)\n",
108 "execution_count": 5,
115 "output_type": "stream",
117 "report on the trojan project having drugged the crew we were able to take the ship with essentially no resistance the crew were handed to the somali pirates at the deepwater rendezvous as planned and we began the survey just after midnight the radar showed an approaching vessel which our database identified as a coastguard cutter we headed south to avoid detection with all ship lights off we then completed the survey in the new location afterdawn with the listening post installed we began assembling the equipment for phase two of the operation keeping a watch for further patrols in the sky and on the water\n"
122 "print(' '.join(segment(sanitise(caesar_decipher(c1b, key_b)))))"
127 "execution_count": null,
137 "display_name": "Python 3",
138 "language": "python",
146 "file_extension": ".py",
147 "mimetype": "text/x-python",
149 "nbconvert_exporter": "python",
150 "pygments_lexer": "ipython3",