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 "(8, -1547.487440811204)"
40 "output_type": "execute_result"
44 "key_a, score = caesar_break(c1a)\n",
57 "output_type": "stream",
60 "I HAVE SCANNED THE ENCRYPTED NOTE THE POLICE FOUND ON JAMELIA'S DESK AND ATTACHED IT FOR YOU TO LOOK AT. THE POLICE DECRYPTED IT FOR THEMSELVES (IT IS VERY STRAIGHTFORWARD ONCE YOU REALISE THAT IT HAS BEEN WRITTEN BACKWARDS - IT JUST USES A CAESAR SHIFT CIPHER). THE OFFICER IN CHARGE OF THE INVESTIGATION MADE IT CLEAR TO ME THAT HE THINKS THIS PROVES JAMELIA'S DEATH IS \"JUST\" A PERSONAL TRAGEDY. CARELESS USE OF THE WORD \"JUST\" EVEN IF HE IS RIGHT, BUT I DON'T THINK HE IS. I HAVE SPOKEN TO HER COLLEAGUES, AND JAMELIA DOESN'T STRIKE ME AS A JUMPER. SHE WAS PRETTY DRIVEN AND HER WORK WAS GOING EXTREMELY WELL. APPARENTLY SHE WAS UNHAPPY ABOUT HER BOYFRIEND LEAVING, BUT A QUICK SCAN OF HER SEARCH HISTORY SUGGESTS SHE WAS PRETTY ACTIVE IN TRYING TO TRACK HIM DOWN. THE POLICE THINK THAT SHOWS HOW DESPERATE SHE WAS. I THINK IT SHOWS THAT SHE WASN'T THE SORT TO GIVE UP EASILY.\n",
61 "ON ONE THING I DO AGREE WITH THE POLICE, IT DOESN'T SEEM VERY LIKELY THAT A PHYSICIST WORKING ON GRAVITY WAVES IS CAUGHT UP IN ANYTHING TOO SUSPICIOUS. HER AREA IS WELL FUNDED AND SINCE THE DISCOVERY OF GRAVITY WAVES A FEW MONTHS AGO IT IS IN THE SPOTLIGHT. HER HEAD OF DEPARTMENT SAYS JAMELIA WAS DESTINED FOR A GOOD CAREER, AND I CAN'T SEE ANYTHING IN HER WORK THAT WOULD BE OF INTEREST TO DARKNET OR GOVERNMENT ACTORS.\n",
62 "TO BE HONEST I AM UNSURE IF I AM CHASING SHADOWS HERE, BUT THEN SHADOW CHASING IS ONE OF YOUR SPECIALITIES SO I WOULD BE REALLY GRATEFUL IF YOU COULD TAKE A LOOK AND LET ME KNOW IF YOU THINK I AM WASTING YOUR TIME.\n",
72 "print(caesar_decipher(c1a, key_a))"
85 "(11, -384.68678644711156)"
90 "output_type": "execute_result"
94 "key_b, score = caesar_break(c1b)\n",
100 "execution_count": 20,
108 "\"E TOY'P ZEPGLST OY PZED LSET YZTE. AZYLP GLSEYZOTZD HZ YPCP, SPYZW LELSEZOYLN TH ZSPPDE. YLN TE TIT QZEO, PEC L EDP'G LSES RTX, PHC PSEP RZ EEF MJE WT FRSE ZMPC LPHOY. L RYT'Y PAALS DLH ELSH ZEOY TW, MS EZMP CPHP HPXYL SE PCZX XTS PXLWMEYLN TPY ZW LSE THWL POZERT, MZZ EDTDTSEO YL XTSOY TQEY LNTOYLP YZ RDL SP. S EFM'O PPC RLP H RYT SE JCPG PCPEQ, LOTL, DPH. RY T SEJ'C PGPC PE QLELSE. PV TWE QP WPS. P GPTW PM EYL NT.\\n\""
111 "execution_count": 20,
113 "output_type": "execute_result"
122 "execution_count": 25,
129 "output_type": "stream",
131 "icant believe he left like that after everything we said after everything we agreed but he has gone and icant find him and this is too big to deal with alone icant blame him more than me we were both blind to what was happening and we are both guilty but together we might have started to fix it icant see how i can do that alone here now so i dont have an option it has to end i have to end it\n"
136 "print(wcat(segment(cat(reversed(sanitise(caesar_decipher(c1b, key_b)))))))"
141 "execution_count": null,
151 "display_name": "Python 3",
152 "language": "python",
160 "file_extension": ".py",
161 "mimetype": "text/x-python",
163 "nbconvert_exporter": "python",
164 "pygments_lexer": "ipython3",