From: Neil Smith Date: Fri, 4 Nov 2016 14:09:43 +0000 (+0000) Subject: 2016 challenge 3 X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=f817fcd4b8d45e4c95d71853278e28fb2d5c6f54;p=cipher-tools.git 2016 challenge 3 --- diff --git a/2016/2016-challenge3.ipynb b/2016/2016-challenge3.ipynb new file mode 100644 index 0000000..51e27a8 --- /dev/null +++ b/2016/2016-challenge3.ipynb @@ -0,0 +1,149 @@ +{ + "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', ), -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', ), -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 +} diff --git a/2016/3a.ciphertext b/2016/3a.ciphertext new file mode 100644 index 0000000..9dce044 --- /dev/null +++ b/2016/3a.ciphertext @@ -0,0 +1,9 @@ +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. diff --git a/2016/3b.ciphertext b/2016/3b.ciphertext new file mode 100644 index 0000000..9e12e1d --- /dev/null +++ b/2016/3b.ciphertext @@ -0,0 +1 @@ +DFKAJ FDRSD NCXQU XKNRA BBAKW AGRJJ SDRXU NKARS DNCXQ NIANJ CNBBU FCGND SKWNK IABXA JFDGF JKVIN RMNKA XDKAI DJLFI CFJKF LXKJV FFRXR ANJKW AGIFY AUKPA PFIZA RFDLF IRSDN CXQPN JJXVD NBIAU FVDXK XFDXD NDFXJ SADOX IFDCA DKUXK NRABB AXJNC NYFIN ICJCN DMLNU KMIAI KWNKV FKBAL KEAWX DRXDK WARXV XKNBN VANDR JAACJ KFEAB FFZXD VKFEM SXKJP NSENU ZXDKF KWACN IZAKE SKNZX DVFOA IJCNB BAICF IADXC EBAUF CGAKX KFIJN LKAIP ABALK RSDNC XQPAP AIAEF KWNGG IFNUW ARESJ FCAFD AUBNX CXDVK FPFIZ LFIUX KNRAB BAJNS XDVKW ASPAI AXCGI AJJAR ESKWA PFIZP ARXRK WAIAN DRKWN KKWAS PFMBR EAXDK AIAJK ARXDR AOABF GXDVK WAUFR APAPI FKAXK FBRKW ACPWA IAKFV FXKWF MVWKC NIKXD PNJVF XDVKF RFKWA JNCAE MKKWA DWAKF BRCAW APNDK ARKFK NBZPX KWKWA CWAJN XRKWN KFMIU FRACX VWKEA FLXDK AIAJK KFGFP AILMB GAFGB ANDRX KWFMV WKWAP NJKIS XDVKF VAKCA KFYFX DWXCN DRPFI ZPXKW KWACD FPXKW XDZWA PNJKI SXDVK FPNID CANLK AICNI KXDRX JNGGA NIARX PNJNG GIFNU WARES JFCAF DAUBN XCXDV KFPFI ZLFIN VFOAI DCADK NVADU SZDFP DNJKW AGRJJ SDRXU NKAKW ASPFM BRDKK ABBCA PWNKK WASRX RFIPW SKWAS PAIAX DKAIA JKARE MKKWA SPNDK ARKFZ DFPPW AIACN IKXDW NRVFD AXWNO ANBCF JKLXD XJWAR KAJKX DVKWA BNKAJ KOAIJ XFDFL KWADA KXKXJ EAKKA IKWND NDSFL KWAGI AOXFM JOAIJ XFDJE SJAOA INBFI RAIJF LCNVD XKMRA NDRXW NOADK KMDAR XKSAK XKWXD ZXKWN JIANB GFKAD KXNBN DRXKW XDZKW NKRSD NCXQU XKNRA BBAND RKWAG RJJSD RXUNK AKWXD ZKWNK KFFXN CNLIN XRXKW XDZXD AARKF WXRAX RFDKZ DFPPW AIAKF IMD