--- /dev/null
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "import os,sys,inspect\n",
+ "currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\n",
+ "parentdir = os.path.dirname(currentdir)\n",
+ "sys.path.insert(0,parentdir) \n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "%matplotlib inline\n",
+ "\n",
+ "from cipherbreak import *\n",
+ "\n",
+ "c3a = open('3a.ciphertext').read()\n",
+ "c3b = open('3b.ciphertext').read()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "(('weston', <KeywordWrapAlphabet.from_largest: 3>), -1706.5657011593255)"
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "key_a, score = keyword_break_mp(c3a)\n",
+ "key_a, score"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "harry,\n",
+ "\n",
+ "if jamelia was working on a scheme to weaponise earthquakes, then we need to know how far she had got. i have sent trinity in to work undercover in jamelia’s lab and tasked her to try to infiltrate dynamix from there. trinity isn’t too happy there, jamelia’s office isn’t much bigger than a broom closet, but we need to try to find the code base referred to in the hidden diary entry.\n",
+ "\n",
+ "in the meantime, i have been working on the list of questions you and jamelia were asking. first: why did martin leave? according to his flatmate he flew to geneva for talks with a company called citadelle. our local agents are making enquiries, but it seems that they are that rarest of things, an established arms manufacturer with money worries. second: where is martin now? no-one knows. citadelle deny any knowledge of him, and there is no record of him leaving the country. he has disappeared.\n",
+ "\n",
+ "the most intriguing thing from jamelia’s last message is the reference to the pds syndicate. i have heard rumours of this myself in whitehall. it is all very hush-hush and it is not even clear if it is an official initiative.\n",
+ "\n",
+ "the big news for now is a breakthrough on the so called suicide note. given how small jamelia’s office was, trinity wondered why she had kept a broken printer in there next to the working one. trinity opened it up and found a few modifications which pointed the laser straight at the paper instead of the drum. she got in touch with the lab and got them to take another look at the letter. they found the attached message burned into the paper fibres. it is impossible to see with the naked eye, but the charring shows up under high powered fluoroscopy. over to you for the decryption.\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(keyword_decipher(c3a, key_a[0], key_a[1]))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "(('neural', <KeywordWrapAlphabet.from_largest: 3>), -1476.8535205989874)"
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "key_b, score = keyword_break_mp(c3b)\n",
+ "key_b, score"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "notes on dynamix citadelle the pds syndicate dynamix area small company that relies on postgraduate interns for most of its good ideas the project we worked on for dynamix was signal recognition in a noisy environment citadelle is a major arms manufacturer that got left behind in the digital age and seems to be looking to buy it swayback into the market by taking over smaller more nimble competitors after we left dynamix we were both approached by someone claiming to work for citadelle saying they were impressed by the work we did there and that they would be interested in developing the code we wrote it old them where to go i thought martin was going to do the same but then he told me he wanted to talk with them he said that our code might be of interest to powerful people and i though the was trying to get me to join him and work with them now i think he was trying to warn me after martin disappeared i was approached by someone claiming to work for a government agency known as the pds syndicate they wouldnt tell me what they did or why they were interested but they wanted to know where martin had gone i have almost finished testing the latest version of the net it is better than any of the previous versions by several orders of magnitude and i havent tuned it yeti think it has real potential and i think that dynamix citadelle and the pds syndicate think that too i am afraid i think i need to hide i dont know where to run\n"
+ ]
+ }
+ ],
+ "source": [
+ "print(wcat(segment(sanitise(keyword_decipher(c3b, key_b[0], key_b[1])))))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.5.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 1
+}
--- /dev/null
+YWJJU,
+
+ZN AWDOCZW QWK QGJBZFX GF W KSYODO LG QOWHGFZKO OWJLYIMWBOK, LYOF QO FOOT LG BFGQ YGQ NWJ KYO YWT XGL. Z YWPO KOFL LJZFZLU ZF LG QGJB MFTOJSGPOJ ZF AWDOCZW’K CWE WFT LWKBOT YOJ LG LJU LG ZFNZCLJWLO TUFWDZR NJGD LYOJO. LJZFZLU ZKF’L LGG YWHHU LYOJO, AWDOCZW’K GNNZSO ZKF’L DMSY EZXXOJ LYWF W EJGGD SCGKOL, EML QO FOOT LG LJU LG NZFT LYO SGTO EWKO JONOJJOT LG ZF LYO YZTTOF TZWJU OFLJU.
+
+ZF LYO DOWFLZDO, Z YWPO EOOF QGJBZFX GF LYO CZKL GN IMOKLZGFK UGM WFT AWDOCZW QOJO WKBZFX. NZJKL: QYU TZT DWJLZF COWPO? WSSGJTZFX LG YZK NCWLDWLO YO NCOQ LG XOFOPW NGJ LWCBK QZLY W SGDHWFU SWCCOT SZLWTOCCO. GMJ CGSWC WXOFLK WJO DWBZFX OFIMZJZOK, EML ZL KOODK LYWL LYOU WJO LYWL JWJOKL GN LYZFXK, WF OKLWECZKYOT WJDK DWFMNWSLMJOJ QZLY DGFOU QGJJZOK. KOSGFT: QYOJO ZK DWJLZF FGQ? FG-GFO BFGQK. SZLWTOCCO TOFU WFU BFGQCOTXO GN YZD, WFT LYOJO ZK FG JOSGJT GN YZD COWPZFX LYO SGMFLJU. YO YWK TZKWHHOWJOT.
+
+LYO DGKL ZFLJZXMZFX LYZFX NJGD AWDOCZW’K CWKL DOKKWXO ZK LYO JONOJOFSO LG LYO HTK KUFTZSWLO. Z YWPO YOWJT JMDGMJK GN LYZK DUKOCN ZF QYZLOYWCC. ZL ZK WCC POJU YMKY-YMKY WFT ZL ZK FGL OPOF SCOWJ ZN ZL ZK WF GNNZSZWC ZFZLZWLZPO.
+
+LYO EZX FOQK NGJ FGQ ZK W EJOWBLYJGMXY GF LYO KG SWCCOT KMZSZTO FGLO. XZPOF YGQ KDWCC AWDOCZW’K GNNZSO QWK, LJZFZLU QGFTOJOT QYU KYO YWT BOHL W EJGBOF HJZFLOJ ZF LYOJO FORL LG LYO QGJBZFX GFO. LJZFZLU GHOFOT ZL MH WFT NGMFT W NOQ DGTZNZSWLZGFK QYZSY HGZFLOT LYO CWKOJ KLJWZXYL WL LYO HWHOJ ZFKLOWT GN LYO TJMD. KYO XGL ZF LGMSY QZLY LYO CWE WFT XGL LYOD LG LWBO WFGLYOJ CGGB WL LYO COLLOJ. LYOU NGMFT LYO WLLWSYOT DOKKWXO EMJFOT ZFLG LYO HWHOJ NZEJOK. ZL ZK ZDHGKKZECO LG KOO QZLY LYO FWBOT OUO, EML LYO SYWJJZFX KYGQK MH MFTOJ YZXY HGQOJOT NCMGJGKSGHU. GPOJ LG UGM NGJ LYO TOSJUHLZGF.