From: Neil Smith Date: Fri, 28 Nov 2014 15:13:35 +0000 (+0000) Subject: Fixed railfence ciphers, done challenges 2014 4 and 5 X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=e94ecd0355b6c3b3b02a539455ef1e31e0a53660;p=cipher-training.git Fixed railfence ciphers, done challenges 2014 4 and 5 --- diff --git a/2014-challenge4.ipynb b/2014-challenge4.ipynb index 581e80f..71e4da6 100644 --- a/2014-challenge4.ipynb +++ b/2014-challenge4.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:866e05d3ba3d4529d70b8ae9ad703cd34a42995d3ac2f4f9abf24ad016c51485" + "signature": "sha256:85b017d44c4150025cec1993a3ad84bbb01961530ccda02157c917ba9e7b9019" }, "nbformat": 3, "nbformat_minor": 0, @@ -41,9 +41,9 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 8, + "prompt_number": 2, "text": [ - "" + "" ] }, { @@ -51,11 +51,11 @@ "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD+CAYAAAA+hqL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX+0VeV55z9XKZjoxcs1FsEYr7U0SrVhQojpSuI6/kBp\nJkGcWsWZCjczk1VljHFNp4NkpgOMq5TQ1anamTQmGi40wWiro5gRBIGdmh94lXgMkSBgggUqJAYR\nTFIGRuaP5z2cfc89P/be95593vPe72etvfa73/0++/2x99nPfp/vPueAEEIIIYQQQgghhBBCCCGE\nEEIIIYQQQgghhBAtZQHwMrAVWAWMAbqB9cAOYB3QVVF+J7AduCaWP9UdYydwbyx/DPCwy98MnB/b\nN9fVsQOYM1wdEkIIkZ0e4MfYzRvsBj4XWAb8Z5c3H1jq0pOBIvBrznYX0OH29QMfdumngBkuPQ/4\nokvfBHzDpbuBVzGn0xVLCyGEaCHdwCvAOGAU8CQwHZsNjHdlznHbYLOF+TH7tcBHgAnAj2L5s4Ev\nxcp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lCXBh\nnfIvurZ9EXgS6CKlYxjVuEhbsQebdj2OefI3qf2NkNIHbBT2BLgHi0W+j/on+C+B72EevAP4A+xi\nqsdKTBt4zNnMwp646vHX2Gzn17EL4Qbgv9Yoe59bvoSFAdLwdcwJPe7a9ilgFXYRVzrV0pidCnwa\nczxHXV6jGHszqbxZdmMfpudoTrvmYg5oFPa9mhKP1bH5OOnHbDnWh/h1UytsWeJDVL+et9apL8v1\neW2D/ZXsw5zjdMw5nEbtm+IqLFS1lPITNliY7+cN6olfC6dgn5+k+sJPgf2ujrMblN2AfUa+h800\nPuTs63Ec+BXm4E/DnOo7dS2Md1y7DmDOeBzw98AzwJ/UqWse0IvN/lKFo0IUn0sUsJjmWuD/Vtnf\nU8f2BPBanf2/jU0lT2DxvEazErA4bklE/AeSefCLgatcegO1QztDZRoW1z+B3VReqFGup8Fxdg9f\nk1LR02D/7mGu7xUsXJXmm/k9NfJ3N7CbykAhudF1U6ueRvVluT7TcDr21PsD7JeSJ2B60Lphrqcn\nlj6O3UyPNbCZh2kgvw78HfAwjT/Tf4U5g38GvouFq76H3fhr8RKwGnNU7wHuxx4S/qCOzeeAOZiz\negB7WDyGOb2dVJ85/JE7dompwH8A/m2DPgkhhsBy7OFAhMGfk/0bwJ3AZ7EHyaMNyk6rkjengc1i\n4Pwa+6qJ2cNCyDMGIZrFduxJzZdQmsifz2IzrKnYdfCsWza2slHDRWgagxB5MKNxERE4p2F64/dp\nHKoSQgghhBBCCCGEEEIIIYQQQgghhBBCiBHO/wdc3dBPs9bnrQAAAABJRU5ErkJggg==\n", "text": [ - "" + "" ] } ], - "prompt_number": 8 + "prompt_number": 2 }, { "cell_type": "code", @@ -70,13 +70,13 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 17, + "prompt_number": 3, "text": [ "'prsaoegerauiadmwehdnisnrasawuaaessrefgdosogvorbeeeaartesctdfmenuibrttlmeytumtmeuaikwhutkwerwahmnpwraeesononesebatoihacineetbrotadaktgfeesyioflttlstiiaeosvieonsrrtaupmnnoaencocnuvrsclvdrgctaiihriciaihrsduomrlemcrngleomarfhiuewhalcsasracufrawwsmehulstoaohceletmtoilsepdmumtptrslyrhhntpanwpmoadppdwbeseoassltmlpesletuncorerlclitaosvsiniifwseafortaaduyenenonnsopfhontwkoertcslyvoeiohlufoeioetsthtsbreneveaouepgieesobduorsfeercdyadutaepeadrdigseebfuoggopogalyfewsoeemdntohrebhaaesneworgnfiaulnlwadueodcotrargvuenewhiertlauilmsoniotmuinewaiuewloerstttisdrsasnussiesmerdhetryrhpnlrtereadmredebnntrnenwmoutrdosaneowomcgidciasaontiioiascesissupcrmoybrineyweelaylewtyrtilhsto'" ] } ], - "prompt_number": 17 + "prompt_number": 3 }, { "cell_type": "code", @@ -91,13 +91,13 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 5, + "prompt_number": 4, "text": [ "(('stern', ), -830.5838133421847)" ] } ], - "prompt_number": 5 + "prompt_number": 4 }, { "cell_type": "code", @@ -116,7 +116,7 @@ ] } ], - "prompt_number": 6 + "prompt_number": 5 }, { "cell_type": "code", @@ -131,13 +131,13 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 39, + "prompt_number": 7, "text": [ "(((6, 0, 1, 7, 9, 4, 2, 3, 5, 8, 10), False, True), -1777.161911681522)" ] } ], - "prompt_number": 39 + "prompt_number": 7 }, { "cell_type": "code", @@ -156,7 +156,7 @@ ] } ], - "prompt_number": 40 + "prompt_number": 8 }, { "cell_type": "code", @@ -171,13 +171,13 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 41, + "prompt_number": 9, "text": [ "(((4, 8, 0, 6, 9, 3, 1, 2, 5, 7, 10), False, True), -2823.7851213306785)" ] } ], - "prompt_number": 41 + "prompt_number": 9 }, { "cell_type": "code", @@ -196,7 +196,7 @@ ] } ], - "prompt_number": 42 + "prompt_number": 10 }, { "cell_type": "code", @@ -211,9 +211,9 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 9, + "prompt_number": 11, "text": [ - "" + "" ] }, { @@ -221,18 +221,17 @@ "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAWwAAAD+CAYAAAAeRj9FAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG2lJREFUeJztnXuQHEd9xz9nKX6i43QJSOJhFlwRMi8fCIgTTLw4tmMo\nLFyGKCEvncu4El62EkIsUxBLVBEsqggKSZEUGPsEGIJ4CZOHkRA32AEK4lhnyxjJoFhgkkgmlmXJ\nvOLgzR89q53dm93pmdnp3r75fqqmbntmvvvrX19vb+93XiCEEEIIIYQQQgghhBBCCCGEEEIIIYQQ\nQoiAuArYA9wdvwaYBHYC9wI7gAk/VRNCCNHmOZjB+mRgEWaQPgN4D/Dn8T5XA9d5qZ0QQojjvAa4\nPlF+O2ag3gssi9ctj8tCCCE8sgrYh7FATgW+BrwfeCixz1hPWQghRAUszti+F9iM8al/BMwBP+/Z\npxUvQgghKiRrwAa4IV4A3gX8ADiEsUIOAiuAB9KEZ5xxRmv//v1DqKYQQtSKO4Gp3pUnWAifGP89\nHbgU+DhwM7AuXr8O2J4m3L9/P61WK3W59tpr+26zWcro66YNtd7KWe1V15yBs9LGVJsZ9qeBXwQe\nBd4APIw5K2QbcDlwAFhr8T5dHDhwIK9kaPq6aX3GVs5haH3GVs722AzYv56y7jBwfqGIQgghCrGo\n4vffuHHjxtQNExMTNBqNwm9cRl83rc/YyjkMrc/Yynk+mzZtAtjUu36sUDR7WrEfI4QQwpKxsTFI\nGZ9tDjpWQhRF3vR10/qMrZzD0PqMrZzt8TZgCyGEyIcsESGEGDFGzhIRQgiRD3nYNdD6jK2cw9D6\njK2c7dEMWwghAkEethBCjBjysIUQInDkYddA6zO2cg5D6zO2crZHM2whhAgEedhCCDFiyMMWQojA\nkYddA63P2Mo5DK3P2MrZHpv7YYuCjI9PcuxY/+cTL1mylKNHDzuskRAiZGw87GuA3wceA/YAlwGn\nAZ8EnkbniTNHUrS19rCNDzUo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9 + "prompt_number": 11 }, { "cell_type": "code", "collapsed": false, "input": [ - "c4bs = sanitise(c4b)\n", - "c4bs" + "railfence_break(c4bs)" ], "language": "python", "metadata": {}, @@ -240,19 +239,19 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 17, + "prompt_number": 6, "text": [ - "'prsaoegerauiadmwehdnisnrasawuaaessrefgdosogvorbeeeaartesctdfmenuibrttlmeytumtmeuaikwhutkwerwahmnpwraeesononesebatoihacineetbrotadaktgfeesyioflttlstiiaeosvieonsrrtaupmnnoaencocnuvrsclvdrgctaiihriciaihrsduomrlemcrngleomarfhiuewhalcsasracufrawwsmehulstoaohceletmtoilsepdmumtptrslyrhhntpanwpmoadppdwbeseoassltmlpesletuncorerlclitaosvsiniifwseafortaaduyenenonnsopfhontwkoertcslyvoeiohlufoeioetsthtsbreneveaouepgieesobduorsfeercdyadutaepeadrdigseebfuoggopogalyfewsoeemdntohrebhaaesneworgnfiaulnlwadueodcotrargvuenewhiertlauilmsoniotmuinewaiuewloerstttisdrsasnussiesmerdhetryrhpnlrtereadmredebnntrnenwmoutrdosaneowomcgidciasaontiioiascesissupcrmoybrineyweelaylewtyrtilhsto'" + "(5, -1581.9784460662272)" ] } ], - "prompt_number": 17 + "prompt_number": 6 }, { "cell_type": "code", "collapsed": false, "input": [ - "len(c4bs)/(7*5*19)" + "' '.join(segment(railfence_decipher(c4bs, 5)))" ], "language": "python", "metadata": {}, @@ -260,254 +259,13 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 28, - "text": [ - "1.0" - ] - } - ], - "prompt_number": 28 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "print('\\n'.join(chunks(c4bs, 19)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "prsaoegerauiadmwehd\n", - "nisnrasawuaaessrefg\n", - "dosogvorbeeeaartesc\n", - "tdfmenuibrttlmeytum\n", - "tmeuaikwhutkwerwahm\n", - "npwraeesononesebato\n", - "ihacineetbrotadaktg\n", - "feesyioflttlstiiaeo\n", - "svieonsrrtaupmnnoae\n", - "ncocnuvrsclvdrgctai\n", - "ihriciaihrsduomrlem\n", - "crngleomarfhiuewhal\n", - "csasracufrawwsmehul\n", - "stoaohceletmtoilsep\n", - "dmumtptrslyrhhntpan\n", - "wpmoadppdwbeseoassl\n", - "tmlpesletuncorerlcl\n", - "itaosvsiniifwseafor\n", - "taaduyenenonnsopfho\n", - "ntwkoertcslyvoeiohl\n", - "ufoeioetsthtsbrenev\n", - "eaouepgieesobduorsf\n", - "eercdyadutaepeadrdi\n", - "gseebfuoggopogalyfe\n", - "wsoeemdntohrebhaaes\n", - "neworgnfiaulnlwadue\n", - "odcotrargvuenewhier\n", - "tlauilmsoniotmuinew\n", - "aiuewloerstttisdrsa\n", - "snussiesmerdhetryrh\n", - "pnlrtereadmredebnnt\n", - "rnenwmoutrdosaneowo\n", - "mcgidciasaontiioias\n", - "cesissupcrmoybriney\n", - "weelaylewtyrtilhsto\n" - ] - } - ], - "prompt_number": 29 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "print('\\n'.join(chunks(c4bs, 35)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "prsaoegerauiadmwehdnisnrasawuaaessr\n", - "efgdosogvorbeeeaartesctdfmenuibrttl\n", - "meytumtmeuaikwhutkwerwahmnpwraeeson\n", - "onesebatoihacineetbrotadaktgfeesyio\n", - "flttlstiiaeosvieonsrrtaupmnnoaencoc\n", - "nuvrsclvdrgctaiihriciaihrsduomrlemc\n", - "rngleomarfhiuewhalcsasracufrawwsmeh\n", - "ulstoaohceletmtoilsepdmumtptrslyrhh\n", - "ntpanwpmoadppdwbeseoassltmlpesletun\n", - "corerlclitaosvsiniifwseafortaaduyen\n", - "enonnsopfhontwkoertcslyvoeiohlufoei\n", - "oetsthtsbreneveaouepgieesobduorsfee\n", - "rcdyadutaepeadrdigseebfuoggopogalyf\n", - "ewsoeemdntohrebhaaesneworgnfiaulnlw\n", - "adueodcotrargvuenewhiertlauilmsonio\n", - "tmuinewaiuewloerstttisdrsasnussiesm\n", - "erdhetryrhpnlrtereadmredebnntrnenwm\n", - "outrdosaneowomcgidciasaontiioiasces\n", - "issupcrmoybrineyweelaylewtyrtilhsto\n" - ] - } - ], - "prompt_number": 30 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "print('\\n'.join(chunks(c4bs, 5)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", + "prompt_number": 7, "text": [ - "prsao\n", - "egera\n", - "uiadm\n", - "wehdn\n", - "isnra\n", - "sawua\n", - "aessr\n", - "efgdo\n", - "sogvo\n", - "rbeee\n", - "aarte\n", - "sctdf\n", - "menui\n", - "brttl\n", - "meytu\n", - "mtmeu\n", - "aikwh\n", - "utkwe\n", - "rwahm\n", - "npwra\n", - "eeson\n", - "onese\n", - "batoi\n", - "hacin\n", - "eetbr\n", - "otada\n", - "ktgfe\n", - "esyio\n", - "flttl\n", - "stiia\n", - "eosvi\n", - "eonsr\n", - "rtaup\n", - "mnnoa\n", - "encoc\n", - "nuvrs\n", - "clvdr\n", - "gctai\n", - "ihric\n", - "iaihr\n", - "sduom\n", - "rlemc\n", - "rngle\n", - "omarf\n", - "hiuew\n", - "halcs\n", - "asrac\n", - "ufraw\n", - "wsmeh\n", - "ulsto\n", - "aohce\n", - "letmt\n", - "oilse\n", - "pdmum\n", - "tptrs\n", - "lyrhh\n", - "ntpan\n", - "wpmoa\n", - "dppdw\n", - "beseo\n", - "asslt\n", - "mlpes\n", - "letun\n", - "corer\n", - "lclit\n", - "aosvs\n", - "iniif\n", - "wseaf\n", - "ortaa\n", - "duyen\n", - "enonn\n", - "sopfh\n", - "ontwk\n", - "oertc\n", - "slyvo\n", - "eiohl\n", - "ufoei\n", - "oetst\n", - "htsbr\n", - "eneve\n", - "aouep\n", - "giees\n", - "obduo\n", - "rsfee\n", - "rcdya\n", - "dutae\n", - "peadr\n", - "digse\n", - "ebfuo\n", - "ggopo\n", - "galyf\n", - "ewsoe\n", - "emdnt\n", - "ohreb\n", - "haaes\n", - "newor\n", - "gnfia\n", - "ulnlw\n", - "adueo\n", - "dcotr\n", - "argvu\n", - "enewh\n", - "iertl\n", - "auilm\n", - "sonio\n", - "tmuin\n", - "ewaiu\n", - "ewloe\n", - "rsttt\n", - "isdrs\n", - "asnus\n", - "siesm\n", - "erdhe\n", - "tryrh\n", - "pnlrt\n", - "eread\n", - "mrede\n", - "bnntr\n", - "nenwm\n", - "outrd\n", - "osane\n", - "owomc\n", - "gidci\n", - "asaon\n", - "tiioi\n", - "asces\n", - "issup\n", - "crmoy\n", - "brine\n", - "yweel\n", - "aylew\n", - "tyrti\n", - "lhsto\n" + "'phase four the decks were cleared by two am and the mounting plates were prepared and measured mounting points were assembled by four am though owing to the approaching dawn deployment of seabird was postponed and we embarked onstage two of seahorse assembly with camouflage plates installed we set to cruising in case of air or sea surveillance following standard routes to avoid suspicion monitoring of airwaves gave no cause for concern but we have raised security levels and are using a column transposition cipher for this communication with keyword seabird future comms will relyon even more security tonight will be used for more sea trials of the nautilus system while the assembly crew rest and the survey team carryout further mapping we will resume the seahorse build at dusk tomorrow'" ] } ], - "prompt_number": 32 + "prompt_number": 7 }, { "cell_type": "code", diff --git a/2014-challenge5.ipynb b/2014-challenge5.ipynb new file mode 100644 index 0000000..4eecb6a --- /dev/null +++ b/2014-challenge5.ipynb @@ -0,0 +1,272 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7aee1c5a7be0ded7315a453bbefef56aee8217ed72fa1276cfe88f18bc828f77" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "import collections\n", + "import string\n", + "%matplotlib inline\n", + "\n", + "from cipherbreak import *\n", + "\n", + "c5a = open('2014/5a.ciphertext').read()\n", + "c5b = open('2014/5b.ciphertext').read()" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "freqs = pd.Series(english_counts)\n", + "freqs.plot(kind='bar')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD+CAYAAAA+hqL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX+0VeV55z9XKZjoxcs1FsEYr7U0SrVhQojpSuI6/kBp\nJkGcWsWZCjczk1VljHFNp4NkpgOMq5TQ1anamTQmGi40wWiro5gRBIGdmh94lXgMkSBgggUqJAYR\nTFIGRuaP5z2cfc89P/be95593vPe72etvfa73/0++/2x99nPfp/vPueAEEIIIYQQQgghhBBCCCGE\nEEIIIYQQQgghhBAtZQHwMrAVWAWMAbqB9cAOYB3QVVF+J7AduCaWP9UdYydwbyx/DPCwy98MnB/b\nN9fVsQOYM1wdEkIIkZ0e4MfYzRvsBj4XWAb8Z5c3H1jq0pOBIvBrznYX0OH29QMfdumngBkuPQ/4\nokvfBHzDpbuBVzGn0xVLCyGEaCHdwCvAOGAU8CQwHZsNjHdlznHbYLOF+TH7tcBHgAnAj2L5s4Ev\nxcpc5tKjgJ+59M3A38RsvuTshBBCNJFTGuw/CPwl8I/APwGHsBDSeOCAK3OAspOYCOyN2e8Fzq2S\nv8/l49Z7XPo48BZwVp1jCSGEaCKNHMOFwJ1YWGgicAbwhxVlTrhFCCFEAIxqsP9DwHeBn7vtx4Df\nBfZjIaT9WJjop27/PuC8mP17sSf9fS5dmV+yeR82IxkFnOnq2wcUYjbnARsrG3jhhReeePXVVxt0\nQwghRAUvAVOq7Wg0Y9iOaQTvwkTkq4FtmNYw15WZCzzu0qsxHWA0cAEwCROd9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Pgf2ujrMblN2AfUa+h800\nPuTs63Ec+BXm4E/DnOo7dS2Md1y7DmDOeBzw98AzwJ/UqWse0IvN/lKFo0IUn0sUsJjmWuD/Vtnf\nU8f2BPBanf2/jU0lT2DxvEazErA4bklE/AeSefCLgatcegO1QztDZRoW1z+B3VReqFGup8Fxdg9f\nk1LR02D/7mGu7xUsXJXmm/k9NfJ3N7CbykAhudF1U6ueRvVluT7TcDr21PsD7JeSJ2B60Lphrqcn\nlj6O3UyPNbCZh2kgvw78HfAwjT/Tf4U5g38GvouFq76H3fhr8RKwGnNU7wHuxx4S/qCOzeeAOZiz\negB7WDyGOb2dVJ85/JE7dompwH8A/m2DPgkhhsBy7OFAhMGfk/0bwJ3AZ7EHyaMNyk6rkjengc1i\n4Pwa+6qJ2cNCyDMGIZrFduxJzZdQmsifz2IzrKnYdfCsWza2slHDRWgagxB5MKNxERE4p2F64/dp\nHKoSQgghhBBCCCGEEEIIIYQQQgghhBBCiBHO/wdc3dBPs9bnrQAAAABJRU5ErkJggg==\n", + "text": [ + "" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "c5bs = sanitise(c5b)\n", + "c5bs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 3, + "text": [ + "'sssatanuelclaendeeheevrnhtailsltocsoeoanuodoeecaferbetrtenoiiucrwurfaproeercssoeuatulgtematremlieaveieogcelesaeeeyyiuuoaidaosdmdecsshthuhatcnxaererseltunaghanrdtevepisydtaeamcinmrnweoramrvibodsdfdpatimrssietdaospecgracnetblfioeushsmeeirlshmittrlnesehmclssoswfottwnbyteyngeymttgstariixeeedrnasmltwgmildcrtseogohrolsshmawndsstrabndnecfcayehotdornonenecatneavoeaatehercyrighsayrefsooatemncwtkaaawndadmsllnnnlutfoeeenoyoewtmanrrsxhvorolhisfunnthaeeofolphebaatmnornoeodnvtphnoetedeaeonphpaeuratvhndetahrahpoorsefovddsttpsvgraaatodsuryidovtrelerltmemdheoarshoarrrerxisgeifawfaiyidusiyieeesotkeaelatresntifemteiaighaceiondktkitteaeanecnndictnedddenstsheanrtamneahshidaocnuissctehslnlectheetlltidlcttnpnmcvsvnositdaelxpihsfattysfoedcmwhtebaachertaigriuirtngiaphetrowehwswaacmgcouwoogoegsmtarteeiemvayinogstitagblncstcycolretedarehopnebyegwcteetlteyeteenansafmo'" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "key_a, score = keyword_break_mp(c5a)\n", + "key_a, score" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 4, + "text": [ + "(('seabird', ), -1255.0542494109186)" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print(' '.join(segment(keyword_decipher(sanitise(c5a), key_a[0], key_a[1]))))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "harry i cracked that last message for myself and noticed something really odd the text said it was encrypted using a column transposition with keyword seabird but it was enciphered using a rail fence cipher i can only assume that the text we retrieved was an archive of the original message re encrypted for safety whoever the flag day associates are they have a pretty sophisticated operation if they are filing messages like this more like one of the major terrorist groups than the usual hacker collective the tech guys took a look at the aerial from the boat and they tell me that it is a drag wire usually used to communicate with a submarine when submerged it carried an acoustic transducer array as well as a shortwave transmitter and listening gear one thing that puzzles me now is why we were allowed to find the ship floating at all surely they must have planned to sink her using the scuttling equipment otherwise what was it for they seem too smart to leave it floating for us to find any thoughts mark ps just before i sent this the cipher clerk came in with a decrypt of the attached columnar transposition keyword has length six think it answers some of our questions about the nautilus system\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "key_b, score = column_transposition_break_mp(c5bs)\n", + "key_b, score" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 6, + "text": [ + "(((3, 2, 4, 1, 5, 0), False, True), -1998.321513226948)" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print(' '.join(segment(sanitise(column_transposition_decipher(sanitise(c5bs), key_b[0], \n", + " fillcolumnwise=key_b[1], \n", + " emptycolumnwise=key_b[2])))))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "phase five seahorse is ready for trials and the nautilus system is fully functional we engaged the mechanism and lowered the deck to three feet above sealevel approaching the shore by the radar station at all times signals from their communications were monitored and no sign was given that our approach had been monitored or even noticed we backed off the deck was raised by two feet and the approach attempted again once more our incursion was unnoticed overnight we conducted a range of tests and mapped the radar coverage on three separate occasions there seems to have been a flurry of activity and our modeling suggests that the ships masts may have triggered brief alarms on all occasions the automatic dive systems cut incorrectly lowering the decks to sealevel and the alarms were cancelled the seahorse deployment system will be fully mounted tonight and we will conduct a battery of tests on the deployment and emergency recovery systems over the next two nights assuming that sea and air traffic remains low xxxx\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "key_b, score = column_transposition_break_mp(c5bs, fitness=Ptrigrams)\n", + "key_b, score" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 8, + "text": [ + "(((3, 2, 4, 1, 5, 0), False, True), -2821.4971440358026)" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print(' '.join(segment(sanitise(column_transposition_decipher(c5bs, key_b[0], \n", + " fillcolumnwise=key_b[1], emptycolumnwise=key_b[2])))))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "phase five seahorse is ready for trials and the nautilus system is fully functional we engaged the mechanism and lowered the deck to three feet above sealevel approaching the shore by the radar station at all times signals from their communications were monitored and no sign was given that our approach had been monitored or even noticed we backed off the deck was raised by two feet and the approach attempted again once more our incursion was unnoticed overnight we conducted a range of tests and mapped the radar coverage on three separate occasions there seems to have been a flurry of activity and our modeling suggests that the ships masts may have triggered brief alarms on all occasions the automatic dive systems cut incorrectly lowering the decks to sealevel and the alarms were cancelled the seahorse deployment system will be fully mounted tonight and we will conduct a battery of tests on the deployment and emergency recovery systems over the next two nights assuming that sea and air traffic remains low xxxx\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "transpositions[key_b[0]]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 41, + "text": [ + "['tokens',\n", + " 'trials',\n", + " 'tricks',\n", + " 'tromps',\n", + " 'umiaks',\n", + " 'unfair',\n", + " 'urbans',\n", + " 'urgent',\n", + " 'vocals',\n", + " 'womans',\n", + " 'womens',\n", + " 'wreaks',\n", + " 'wrecks',\n", + " 'yokels',\n", + " 'ricardo',\n", + " 'sneaker',\n", + " 'speaker',\n", + " 'tobagos',\n", + " 'trebles',\n", + " 'woolens',\n", + " 'sneakers',\n", + " 'speakers',\n", + " 'speedier',\n", + " 'tobaccos',\n", + " 'together',\n", + " 'treaties',\n", + " 'treatise',\n", + " 'trollops',\n", + " 'unedited',\n", + " 'woollens',\n", + " 'wreckers',\n", + " 'treatises',\n", + " 'triteness',\n", + " 'usherette',\n", + " 'woodcocks',\n", + " 'tritenesss',\n", + " 'usherettes']" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/2014-challenge6.ipynb b/2014-challenge6.ipynb new file mode 100644 index 0000000..ebc0e1f --- /dev/null +++ b/2014-challenge6.ipynb @@ -0,0 +1,295 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2fd72ba7fe3bce3be5a85e8242c119102b9a08ef8f13a01e1c8f9d30d9474858" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "import collections\n", + "import string\n", + "%matplotlib inline\n", + "\n", + "from cipherbreak import *\n", + "\n", + "c6a = open('2014/6a.ciphertext').read()\n", + "c6b = open('2014/6b.ciphertext').read()" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "freqs = pd.Series(english_counts)\n", + "freqs.plot(kind='bar')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD+CAYAAAA+hqL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX+0VeV55z9XKZjoxcs1FsEYr7U0SrVhQojpSuI6/kBp\nJkGcWsWZCjczk1VljHFNp4NkpgOMq5TQ1anamTQmGi40wWiro5gRBIGdmh94lXgMkSBgggUqJAYR\nTFIGRuaP5z2cfc89P/be95593vPe72etvfa73/0++/2x99nPfp/vPueAEEIIIYQQQgghhBBCCCGE\nEEIIIYQQQgghhBAtZQHwMrAVWAWMAbqB9cAOYB3QVVF+J7AduCaWP9UdYydwbyx/DPCwy98MnB/b\nN9fVsQOYM1wdEkIIkZ0e4MfYzRvsBj4XWAb8Z5c3H1jq0pOBIvBrznYX0OH29QMfdumngBkuPQ/4\nokvfBHzDpbuBVzGn0xVLCyGEaCHdwCvAOGAU8CQwHZsNjHdlznHbYLOF+TH7tcBHgAnAj2L5s4Ev\nxcpc5tKjgJ+59M3A38RsvuTshBBCNJFTGuw/CPwl8I/APwGHsBDSeOCAK3OAspOYCOyN2e8Fzq2S\nv8/l49Z7XPo48BZwVp1jCSGEaCKNHMOFwJ1YWGgic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9Yoe59bvoSFAdLwdcwJPe7a9ilgFXYRVzrV0pidCnwa\nczxHXV6jGHszqbxZdmMfpudoTrvmYg5oFPa9mhKP1bH5OOnHbDnWh/h1UytsWeJDVL+et9apL8v1\neW2D/ZXsw5zjdMw5nEbtm+IqLFS1lPITNliY7+cN6olfC6dgn5+k+sJPgf2ujrMblN2AfUa+h800\nPuTs63Ec+BXm4E/DnOo7dS2Md1y7DmDOeBzw98AzwJ/UqWse0IvN/lKFo0IUn0sUsJjmWuD/Vtnf\nU8f2BPBanf2/jU0lT2DxvEazErA4bklE/AeSefCLgatcegO1QztDZRoW1z+B3VReqFGup8Fxdg9f\nk1LR02D/7mGu7xUsXJXmm/k9NfJ3N7CbykAhudF1U6ueRvVluT7TcDr21PsD7JeSJ2B60Lphrqcn\nlj6O3UyPNbCZh2kgvw78HfAwjT/Tf4U5g38GvouFq76H3fhr8RKwGnNU7wHuxx4S/qCOzeeAOZiz\negB7WDyGOb2dVJ85/JE7dompwH8A/m2DPgkhhsBy7OFAhMGfk/0bwJ3AZ7EHyaMNyk6rkjengc1i\n4Pwa+6qJ2cNCyDMGIZrFduxJzZdQmsifz2IzrKnYdfCsWza2slHDRWgagxB5MKNxERE4p2F64/dp\nHKoSQgghhBBCCCGEEEIIIYQQQgghhBBCiBHO/wdc3dBPs9bnrQAAAABJRU5ErkJggg==\n", + "text": [ + "" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "freqs_6a = pd.Series(collections.Counter([l.lower() for l in c6a if l in string.ascii_letters]))\n", + "freqs_6a.plot(kind='bar')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 11, + "text": [ + "" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD+CAYAAAAnIY4eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG3JJREFU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HVjgebh2uQ63UdTFicDncUf9b0pfvztE49t+W3AHLl2exvA+6NPX\nffvtPbgj3R+leW3BHWDk0T0YWo+zEyG/770zne//ZGJswV08fVmBHLNM4wpgEV6MK5j3ADcU1CzD\ntfe5wE8Y3oYH4H41fRdX1M+luOuxD66IfxG3TBcCRxTUjv3phztwPyk24vZ8j5J/NXy30y/DHUnt\nwHlkz2Z4I38EuBW315sA3oxbsXlcivO1r0o1p+KOWobxSdwvi2fhVsjvAX85YNpPpK9/xP0ELsNl\nuJ3GxjS/NwKX4zpUvx1it/32BU7H7SweT8cN84VD0FvUpnEd/Dbqy28dbqexDHfPQ5ercjTH4dd+\nl+CWJdufBtl7XV5G/76+JSemb7/97QLT9PIQbse2FlfM9ye/eF2Os3DWM3/0Cs4K++8hsbL9Yx/c\n9lXUH/8p8HAa45kFpr8Btx3dijuaf1k6jzx+Dfwvbge9P26H+ESuYp4n0vx24namK4GvAN8APjBM\nbOkQvo3z2q4DfjVgmlaOfg74jyExXoD7yTQH3Eixo/+jmT859S3yjzayPB94Xfr5BvKtjiocg/Oj\n53Ab/Pdzpm0Nmdf20aTkTWvI99triHkPzsIpc1dya8D47QW0R7PwxOWw/jQo1rCYvv22LAfgjiTv\nwD3x9CDc+Y3ra4jVynz+Na7o7R2iOQPn4z8L+DLwJYpt9x/DFe9fArfgLJxbcYV6EJuBq3E7l98A\n/gm3o3/zkFjvBd6O28l8DncQuBe3s7qPEkfmQixVLsHt4EWc/C3V7oZcAbwbd5D4+JBpj+kz7u0F\nYlwA/OaA7/qdQF2EpSNyIcbBNtwRjzWbSYyXd+N+0RyN6xs3p68bx5nUIMbtkQsxbk4aPolYguyP\nO6/2Q4bbN0IIIYQQQgghhBBCCCGEEEIIIYQQQixB/h+QzzRVXRW/NwAAAABJRU5ErkJggg==\n", + "text": [ + "" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "freqs_6b = pd.Series(collections.Counter([l.lower() for l in c6b if l in string.ascii_letters]))\n", + "freqs_6b.plot(kind='bar')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 6, + "text": [ + "" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAWwAAAD+CAYAAAAeRj9FAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGMxJREFUeJztnX+QJGV9h5+Fi/Lrlrst8Tg1ugkVglrGU8SYUsuJQWOI\nXCiNVJmkZNVYRg1CoobDigJWqSepxCtNTKJR7lSMEn8gWKjguaNIlMTIIYqAOb0EU96ReJADRIOy\n+ePtcWdnp2e6353pebvneaqmdrrn/cz32++veefTPb0gIiIiIiIiIiIiIiIiIiIiIiIiIjVjA/BR\n4FvAzcCvAnPANcBtwNVZGRERmTC7gJdkz9cBxwIXA3+W7TsP2D6BvEREpItjge/02X8LsCl7fny2\nLSIiE2QLcD1wCfA14D3A0cCdXWVmerZFRGTEHFagzDrgicC7sr/3Att6yixlDxERGRPrCpT5Xvb4\n12z7o8D5wH6CFbIf2Azc0Ss84YQTlvbu3TuaTEVEpocbCe7GCoqssPcDtwMnZtunAt8ErgTOyvad\nBVzeK9y7dy9LS0urHhdccEHf/YMe065JNS816ealJt28hmmAx/ebjIussAHOBi4FHgTsBV4MHA5c\nBrwU2AecWfC92LdvX9GiaiqMoSZOk2peatLNK1ZTdMK+ETilz/5TS0cUEZEoDh/z+1944YUXrtq5\nYcMG5ufnS73RtGtSzUtNunmpSTevYZqLLroI4KLe/TOlIpRnKfNjRESkIDMzM9Bnfi5y0nHktNtt\nNSU1qealJt281KSbV6xmIhO2iIiUR0tERCQxkrJERESkPHrYNdGkmpeadPNSk25esRpX2CIiNUEP\nW0QkMfSwRURqjh52TTSp5qUm3bzUpJtXrMYVtohITdDDFhFJDD1sEZGao4ddE02qealJNy816eYV\nq3GFLSJSE/SwRUQSQw9bRKTm6GHXRJNqXmrSz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fyZYLl8mTMh53AhcQfjweAjw\n94QP7hcM0JwDvIjwAfIPhAXc/YQPom/Tf6X98uy9O5wMvAp4yYA4Io3mEsKHtjSDtxL3i7/1wNmE\nBd6Ph5Q9pc++Fw3RXAQ8Kue1ficxR8IkVtgi4+QWwuomJVtIquNswjeSkwl94Nrs8flJJjUqqvKw\nRariOcOLSIM5gnAu62sMt1tERERERERERERERERERERERBLk/wGh1P0qDD3LLgAAAABJRU5ErkJg\ngg==\n", + "text": [ + "" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "c6as = sanitise(c6a)\n", + "c6as" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 7, + "text": [ + "'mtaeglatcleptenopeautelebiiootatwnantateituiiagaeostgvetabdresiacqobwavgrhrsihssaekajbwwttdrsmeetnyafsegilegtkrreocuantteomsgstnsiaeluutrbaiaeteeserhxgtooarrbhpcklialhnaesvearhbepiydcesewtaxuyaerywoeinhteegeisieireaassrbitnhtuorooleewsttereoahyakhlsmsaeodslthsutigqimnidsgetpmwtrnnotfhvselkaumrndvcnrluceryhyeetlnigouncnanrhpnosbhshpslreclvrinfoehniaeennhcrbenrgunruesmlrehiutgteordroeaeoisoeusiknteeslohthdcrmisuteoteaeoshfaiaesemritrseisaigwyrmhrbtetncoenuhorcadeodlcrncomnctosihudtcinagesntisutigytmshthyalatlsnhilguimtlbfldyhrfrnetsaosteetaefhlgokhretcakuteihrlrtlsetshlcpeadhthyutaeennhryraeennihrnbhnsnehyutsdtoywmtiatalwhvbepetlxihuscrtadtikhnxmsaesnwluevgnrcpegvnhteruigeuealsdntikeaeomctwrybusiilephkyodhrsyhecaatrmrltrarretstuoetnuesiduaidoesisaeetbllerpntroisiatsiasesomihsieiaunsaitneelacrfnrnngvetteenslhvpepteonedtnaooutgsotancetimiiwoetiuihclsewtcniieotslfbeecohenpoelsdoctceeemiiirttmhbiuovecegaitjuaborcleentatruyinetsidlaeehitwencceohwvohoatwkteroarhcseer'" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "c6bs = sanitise(c6b)\n", + "c6bs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 3, + "text": [ + "'hwssswxfewhhrfewpdrvttdhxbccleayphalnadhiehaoudrotwnrrvysabjlttbaytmelrkaidopthatlelrtwaamaneksvvzrvllatkcrjquicizgtoqcpnrrkttowandqehtqrvtbaydqealannohulanuzlwextlvjrvivhnohdqmgykaclmswrupdetfioftfelhzpxhaswftwprrsweiseohefpdrvttnvagdvswgoerbetnharvaeevtlltbmgaiatgelinmdawevhatterdhrznbnvoutnefoteveaehlaymhacglzeptvvdimworfisgtuzlwibeqohubtghamqornjnnrumqvjtxeltfovgawdaeevllgrtxibgtibevmpsaateoasevaeyqohameonncfuidoefafattemuimnflznbekofobrliaehhauihnnnwzaeevtlltpaalnanvtzlzuucptaelinanpaahewfthaosetaribnbnvhaevdhyytlmuxb'" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "key_a, score = keyword_break_mp(c6a)\n", + "key_a, score" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 4, + "text": [ + "(('ad', ), -1231.3855550875928)" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print(' '.join(segment(keyword_decipher(sanitise(c6a), key_a[0], key_a[1]))))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "mt aegl at dle pte nope aut elec ii oot a twn an tate itu ii a gae ostg vetacbresiadqocwavgr hrsihssaekajcwwttbrs meet nyafsegilegtkrreodu ant teom sgstnsiaeluutrcaiae teese rhxgtooarrchpdklialh naesvearhcepiybdesew tax uyaerywoeinhteegeisi eire a as src it nh tu or ooleewsttereoahyakhl sms aeobslthsutigqimnibs get pm wtr n not fhvselkaumrnbvdnr luder yhyeetlnigoundnanrhp no schs hp sl red lvr info ehniaeennhdrcenrgun rues mlrehiutgteorbroeaeo is oe us ikn tees loh th bdrm is uteoteaeoshfaiaesemr it rse is aigwyrmhrctetndoenuh or da be obldrndomndtosihubtd in ages ntis utigytmshthyalatlsnh il gui mtl cfl by hr fr net sao steet ae fhlgokhretdakuteihrl rtl sets hldpeabhthyutaeennhr yraeennihrnchnsnehyu tsb toy wmtiatalwhvcepetlxih us dr tab tikhnxmsaesnwluevgnr dpegvnhteruigeuealsb nt ikea eo mdt wrycusiilephkyobhrsy he da at rmrltrarretstuoetnue sibu aibo es is ae etc ller pn troisi at sias eso mi hsie i a unsa it neela dr fnr nng vet teens lhv pep te one bt nao out g sot and e tim i iwo et iuihdlsewtdniieotslf cee do hen poels bod tdeeemiiirttmhciuove de gait jua cordle ent a truy in etsi bla ee hit wend de ohwvohoatwkteroarhd seer\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "key_a, score = column_transposition_break_mp(c6as)\n", + "key_a, score" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 10, + "text": [ + "(((0, 4, 3, 7, 2, 1, 5, 6, 8), False, True), -2617.4798034835794)" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print(' '.join(segment(sanitise(column_transposition_decipher(sanitise(c6as), key_a[0], \n", + " fillcolumnwise=key_a[1], \n", + " emptycolumnwise=key_a[2])))))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "mferkepsethibrsnbeal sir nth ce gate wr so go in olohhlkghcuipeahw tue ssn try uav ilp cer ongaro ltm rtn tee echo trs clparoecilstkblopavd eu temes ron tees geico et wg vs ntp in ssn of cehctthmoearotntieeu leese hhetrnrirsnmetueauii ill hoe iea ie so algie iberhueaeritcyuuunt is a a tenn to hd krash mole h blach tco las irb a pdsid tbi tel man neu wac set en ondra tier vahneeklgentcoeeauct hods acne aym see rrgtunlrofuaetcthmne ii a thx crs tteosgtnmjuesutwnlu in it or grain hioyvebahugabehogrdq ruti ray tir stu cerc mb i et loa in hi ege seni pln tete ad ces engng sk plot vneglhhraeiseikvdt thn tay prr art plo eoubnimhdpeydbswnht air hut are en entre soo ess in syn it in gnvhessaeyoeedoichtt acted qymfranuloushhaasabt hvb to i ewst serokeadhepmunhvtyli rtti go a kylgetryladtsewhwauc rose rmt meat lnstlrsraociisnernhc hand we c test hv tte hosa i cast d hall nxticwewgruumrvkhuly oimoaviuaeiihjbmcetw so beter no uaw pl ryu ett we by we tew ttfhosioktllyeiuttdx dei die eri yen u harsh hth ace om url tilo a esf nedss rec rieoehhtrnggewfcnteo estas ya tui ici eads nss na efta cia i ersion eei seks a ieee ght nr to miner ebtrlxehalsiemtp all tg sans ef rta eos rbs\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "key_a, score = railfence_break(c6as)\n", + "key_a, score" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 16, + "text": [ + "(3, -2314.997881051078)" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "' '.join(segment(railfence_decipher(c6as, key_a)))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 17, + "text": [ + "'mark the last message told usa lot the scuttling equipment is designed to pump water in and out of the vessel like a submarine dive control but clearly they werent planning to turn a container ship into a sub this ship is a largescale version of something i have seen in the caribbean drug runners use a similar technique to get below radar coverage for inshore runs sinking the vessel so that the deck remains just below the wave tops the fda pirates seem more interested in staying away from shore but getting close enough to track and record electronic communications without detection i am guessing this scuttling system is what they call nautilus in their log but i am still baffled by the references to seahorse the next page of the log looks harder to crack but the cipher clerk tells me it is a hill cipher and that they must have been in a hurry or have been enciphering by hand since they just used a two by two matrix actually we have been pretty lax with our security and i think the next message is end will use avi genere cipher given that we are using secure cables i dont think we have too much to worry about so i will keep the keyword short say three characters more later harry'" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/2014/5a.ciphertext b/2014/5a.ciphertext new file mode 100644 index 0000000..c946bc4 --- /dev/null +++ b/2014/5a.ciphertext @@ -0,0 +1 @@ +TSHHP UAHSA WIBKT SKXSJ KYIJJ SDIRC HYPJI XRSZB ZCKUA IBJCY IKTUZ DHISX XPCBB KTIKI OKJSU BUKNS JIZAH PFKIB LJUZD SACXL YZKHS ZJFCJ UKUCZ NUKTW IPNCH BJISE UHBEL KUKNS JIZAU FTIHI BLJUZ DSHSU XRIZA IAUFT IHUAS ZCZXP SJJLY IKTSK KTIKI OKNIH IKHUI MIBNS JSZSH ATUMI CRKTI CHUDU ZSXYI JJSDI HIIZA HPFKI BRCHJ SRIKP NTCIM IHKTI RXSDB SPSJJ CAUSK IJSHI KTIPT SMISF HIKKP JCFTU JKUAS KIBCF IHSKU CZURK TIPSH IRUXU ZDYIJ JSDIJ XUWIK TUJYC HIXUW ICZIC RKTIY SVCHK IHHCH UJKDH CLFJK TSZKT ILJLS XTSAW IHACX XIAKU MIKTI KIATD LPJKC CWSXC CWSKK TISIH USXRH CYKTI ECSKS ZBKTI PKIXX YIKTS KUKUJ SBHSD NUHIL JLSXX PLJIB KCACY YLZUA SKINU KTSJL EYSHU ZINTI ZJLEY IHDIB UKASH HUIBS ZSACL JKUAK HSZJB LAIHS HHSPS JNIXX SJSJT CHKNS MIKHS ZJYUK KIHSZ BXUJK IZUZD DISHC ZIKTU ZDKTS KFLQQ XIJYI ZCNUJ NTPNI NIHIS XXCNI BKCRU ZBKTI JTUFR XCSKU ZDSKS XXJLH IXPKT IPYLJ KTSMI FXSZZ IBKCJ UZWTI HLJUZ DKTIJ ALKKX UZDIG LUFYI ZKCKT IHNUJ INTSK NSJUK RCHKT IPJII YKCCJ YSHKK CXISM IUKRX CSKUZ DRCHL JKCRU ZBSZP KTCLD TKJYS HWFJV LJKEI RCHIU JIZKK TUJKT IAUFT IHAXI HWASY IUZNU KTSBI AHPFK CRKTI SKKSA TIBAC XLYZS HKHSZ JFCJU KUCZW IPNCH BTSJX IZDKT JUOKT UZWUK SZJNI HJJCY ICRCL HGLIJ KUCZJ SECLK KTIZS LKUXL JJPJK IY diff --git a/2014/5b.ciphertext b/2014/5b.ciphertext new file mode 100644 index 0000000..cd61026 --- /dev/null +++ b/2014/5b.ciphertext @@ -0,0 +1 @@ +SSSATA NUELCL AENDEE HEEVRN HTAILS LTOCSO EOANUO DOEECA FERBET RTENOI IUCRWU RFAPRO EERCSS OEUATU LGTEMA TREMLI EAVEIE OGCELE SAEEEY YIUUOA IDAOSD MDECSS HTHUHA TCNXAE RERSEL TUNAGH ANRDTE VEPISY DTAEAM CINMRN WEORAM RVIBOD SDFDPA TIMRSS IETDAO SPECGR ACNETB LFIOEU SHSMEE IRLSHM ITTRLN ESEHMC LSSOSW FOTTWN BYTEYN GEYMTT GSTARI IXEEED RNASML TWGMIL DCRTSE OGOHRO LSSHMA WNDSST RABNDN ECFCAY EHOTDO RNONEN ECATNE AVOEAA TEHERC YRIGHS AYREFS OOATEM NCWTKA AAWNDA DMSLLN NNLUTF OEEENO YOEWTM ANRRSX HVOROL HISFUN NTHAEE OFOLPH EBAATM NORNOE ODNVTP HNOETE DEAEON PHPAEU RATVHN DETAHR AHPOOR SEFOVD DSTTPS VGRAAA TODSUR YIDOVT RELERL TMEMDH EOARSH OARRRE RXISGE IFAWFA IYIDUS IYIEEE SOTKEA ELATRE SNTIFE MTEIAI GHACEI ONDKTK ITTEAE ANECNN DICTNE DDDENS TSHEAN RTAMNE AHSHID AOCNUI SSCTEH SLNLEC THEETL LTIDLC TTNPNM CVSVNO SITDAE LXPIHS FATTYS FOEDCM WHTEBA ACHERT AIGRIU IRTNGI APHETR OWEHWS WAACMG COUWOO GOEGSM TARTEE IEMVAY INOGST ITAGBL NCSTCY COLRET EDAREH OPNEBY EGWCTE ETLTEY ETEENA NSAFMO diff --git a/2014/6a.ciphertext b/2014/6a.ciphertext new file mode 100644 index 0000000..c80f291 --- /dev/null +++ b/2014/6a.ciphertext @@ -0,0 +1 @@ +MTAEG LATCL EPTEN OPEAU TELEB IIOOT ATWNA NTATE ITUII AGAEO STGVE TABDR ESIAC QOBWA VGRHR SIHSS AEKAJ BWWTT DRSME ETNYA FSEGI LEGTK RREOC UANTT EOMSG STNSI AELUU TRBAI AETEE SERHX GTOOA RRBHP CKLIA LHNAE SVEAR HBEPI YDCES EWTAX UYAER YWOEI NHTEE GEISI EIREA ASSRB ITNHT UOROO LEEWS TTERE OAHYA KHLSM SAEOD SLTHS UTIGQ IMNID SGETP MWTRN NOTFH VSELK AUMRN DVCNR LUCER YHYEE TLNIG OUNCN ANRHP NOSBH SHPSL RECLV RINFO EHNIA EENNH CRBEN RGUNR UESML REHIU TGTEO RDROE AEOIS OEUSI KNTEE SLOHT HDCRM ISUTE OTEAE OSHFA IAESE MRITR SEISA IGWYR MHRBT ETNCO ENUHO RCADE ODLCR NCOMN CTOSI HUDTC INAGE SNTIS UTIGY TMSHT HYALA TLSNH ILGUI MTLBF LDYHR FRNET SAOST EETAE FHLGO KHRET CAKUT EIHRL RTLSE TSHLC PEADH THYUT AEENN HRYRA EENNI HRNBH NSNEH YUTSD TOYWM TIATA LWHVB EPETL XIHUS CRTAD TIKHN XMSAE SNWLU EVGNR CPEGV NHTER UIGEU EALSD NTIKE AEOMC TWRYB USIIL EPHKY ODHRS YHECA ATRMR LTRAR RETST UOETN UESID UAIDO ESISA EETBL LERPN TROIS IATSI ASESO MIHSI EIAUN SAITN EELAC RFNRN NGVET TEENS LHVPE PTEON EDTNA OOUTG SOTAN CETIM IIWOE TIUIH CLSEW TCNII EOTSL FBEEC OHENP OELSD OCTCE EEMII IRTTM HBIUO VECEG AITJU ABORC LEENT ATRUY INETS IDLAE EHITW ENCCE OHWVO HOATW KTERO ARHCS EER diff --git a/2014/6b.ciphertext b/2014/6b.ciphertext new file mode 100644 index 0000000..84e0dcc --- /dev/null +++ b/2014/6b.ciphertext @@ -0,0 +1 @@ +HWSSS WXFEW HHRFE WPDRV TTDHX BCCLE AYPHA LNADH IEHAO UDROT WNRRV YSABJ LTTBA YTMEL RKAID OPTHA TLELR TWAAM ANEKS VVZRV LLATK CRJQU ICIZG TOQCP NRRKT TOWAN DQEHT QRVTB AYDQE ALANN OHULA NUZLW EXTLV JRVIV HNOHD QMGYK ACLMS WRUPD ETFIO FTFEL HZPXH ASWFT WPRRS WEISE OHEFP DRVTT NVAGD VSWGO ERBET NHARV AEEVT LLTBM GAIAT GELIN MDAWE VHATT ERDHR ZNBNV OUTNE FOTEV EAEHL AYMHA CGLZE PTVVD IMWOR FISGT UZLWI BEQOH UBTGH AMQOR NJNNR UMQVJ TXELT FOVGA WDAEE VLLGR TXIBG TIBEV MPSAA TEOAS EVAEY QOHAM EONNC FUIDO EFAFA TTEMU IMNFL ZNBEK OFOBR LIAEH HAUIH NNNWZ AEEVT LLTPA ALNAN VTZLZ UUCPT AELIN ANPAA HEWFT HAOSE TARIB NBNVH AEVDH YYTLM UXB diff --git a/LJ!-Qt!-Fghxft-dferts;-hsjeukaxxn-sfedw.ipynb b/LJ!-Qt!-Fghxft-dferts;-hsjeukaxxn-sfedw.ipynb new file mode 100644 index 0000000..67f4598 --- /dev/null +++ b/LJ!-Qt!-Fghxft-dferts;-hsjeukaxxn-sfedw.ipynb @@ -0,0 +1,279 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:256d7cbeceb110bdd970d796e22b0b9a746259f81a6da52f94b471762908873e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from cipherbreak import *" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ct = \"LJ! Qt! Fghxft dferts; hsjeukaxxn sfedw.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ctu = ct.upper()\n", + "ctu" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 10, + "text": [ + "'LJ! QT! FGHXFT DFERTS; HSJEUKAXXN SFEDW.'" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ctu4 = ctu.split()[4]\n", + "ctu2 = ctu.split()[2]\n", + "ctu3 = ctu.split()[3]" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 27 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "seeds4 = [w for w in keywords if len(w) == 10 and w[-2] == w[-3] and len(set(w)) == 9]\n", + "len(seeds4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 14, + "text": [ + "50" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "seeds2 = [w for w in keywords if len(w) == 6 and w[0] == w[-2] and len(set(w)) == 5]\n", + "len(seeds2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 17, + "text": [ + "283" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "seeds3 = [w for w in keywords if len(w) == 6 and len(set(w)) == 6]\n", + "len(seeds3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 26, + "text": [ + "5252" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for s in seeds4:\n", + " print(ctu.translate(''.maketrans({f: t for f, t in zip(ctu4, s)})))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Lc! QT! FGaeFT DFtRTu; auctioneer uFtDW.\n", + "La! QT! FGblFT DFsRTo; boastfully oFsDW.\n", + "Le! QT! FGclFT DFrRTa; caerphilly aFrDW.\n", + "Lt! QT! FGcoFT DFhRTa; catherwood aFhDW.\n", + "Li! QT! FGcoFT DFlRTh; childproof hFlDW.\n", + "Lt! QT! FGclFT DFrRTi; citronella iFrDW.\n", + "Lo! QT! FGelFT DFtRTr; erotically rFtDW.\n", + "Lh! QT! FGelFT DFnRTt; ethnically tFnDW.\n", + "Lo! QT! FGelFT DFtRTx; exotically xFtDW.\n", + "Lr! QT! FGgeFT DFnRTa; garnisheed aFnDW.\n", + "La! QT! FGglFT DFcRTr; gracefully rFcDW.\n", + "La! QT! FGglFT DFtRTr; gratefully rFtDW.\n", + "Lr! QT! FGhlFT DFoRTe; heroically eFoDW.\n", + "Ln! QT! FGhlFT DFtRTu; huntsville uFtDW.\n", + "Lf! QT! FGilFT DFoRTn; informally nFoDW.\n", + "Lg! QT! FGloFT DFhRTi; lightproof iFhDW.\n", + "Lg! QT! FGlrFT DFaRTo; loganberry oFaDW.\n", + "Lr! QT! FGmlFT DFcRTe; mercifully eFcDW.\n", + "Lt! QT! FGmlFT DFrRTe; metrically eFrDW.\n", + "Ll! QT! FGmeFT DFwRTi; milwaukees iFwDW.\n", + "Lr! QT! FGmlFT DFtRTi; mirthfully iFtDW.\n", + "Lg! QT! FGnlFT DFhRTi; nightfalls iFhDW.\n", + "Lr! QT! FGpoFT DFeRTa; parenthood aFeDW.\n", + "Lr! QT! FGplFT DFsRTe; personally eFsDW.\n", + "Lo! QT! FGplFT DFnRTh; phonically hFnDW.\n", + "Lr! QT! FGplFT DFaRTi; pirandello iFaDW.\n", + "Le! QT! FGplFT DFtRTo; poetically oFtDW.\n", + "Lw! QT! FGplFT DFeRTo; powerfully oFeDW.\n", + "Li! QT! FGpoFT DFeRTr; priesthood rFeDW.\n", + "Lo! QT! FGplFT DFdRTr; prodigally rFdDW.\n", + "Lg! QT! FGrlFT DFiRTe; regionally eFiDW.\n", + "Lg! QT! FGrlFT DFhRTi; rightfully iFhDW.\n", + "Ls! QT! FGrlFT DFtRTu; rustically uFtDW.\n", + "Lo! QT! FGslFT DFrRTc; scornfully cFrDW.\n", + "La! QT! FGslFT DFmRTh; shamefully hFmDW.\n", + "Li! QT! FGslFT DFtRTp; spitefully pFtDW.\n", + "Lu! QT! FGsoFT DFiRTq; squirehood qFiDW.\n", + "Lr! QT! FGslFT DFgRTu; surgically uFgDW.\n", + "Lb! QT! FGtoFT DFlRTa; tablespoon aFlDW.\n", + "Lm! QT! FGtlFT DFpRTe; temporally eFpDW.\n", + "Lr! QT! FGtlFT DFmRTe; terminally eFmDW.\n", + "La! QT! FGtlFT DFnRTh; thankfully hFnDW.\n", + "La! QT! FGtlFT DFnRTr; tranquilly rFnDW.\n", + "Le! QT! FGtlFT DFaRTr; treadmills rFaDW.\n", + "Ld! QT! FGuoFT DFeRTn; undershoot nFeDW.\n", + "Lr! QT! FGvlFT DFtRTe; vertically eFtDW.\n", + "Ls! QT! FGwlFT DFtRTa; wastefully aFtDW.\n", + "Lt! QT! FGwlFT DFcRTa; watchfully aFcDW.\n", + "La! QT! FGwlFT DFtRTr; wrathfully rFtDW.\n", + "Lo! QT! FGwlFT DFnRTr; wrongfully rFnDW.\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ct" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 21, + "text": [ + "'LJ! Qt! Fghxft dferts; hsjeukaxxn sfedw.'" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for s4 in seeds4:\n", + " for s2 in seeds2:\n", + " if s2[2] == s4[0] and s2[3] == s4[8]:\n", + " transdict = {f: t for f, t in zip(ctu4 + ctu2, s4 + s2)}\n", + " if len(set(transdict.values())) == len(transdict):\n", + " print(ctu.translate(''.maketrans(transdict)))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Lo! Qs! phelps DptRsr; erotically rptDW.\n", + "Lo! Qs! phelps DptRsx; exotically xptDW.\n", + "Lf! Qd! exiled DeoRdn; informally neoDW.\n", + "Lf! Qs! exiles DeoRsn; informally neoDW.\n", + "Lg! Qs! nylons DnhRsi; lightproof inhDW.\n", + "Le! Qg! unplug DutRgo; poetically outDW.\n", + "Lg! Qs! earles DehRsi; rightfully iehDW.\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for s4 in seeds4:\n", + " for s2 in seeds2:\n", + " if s2[2] == s4[0] and s2[3] == s4[8]:\n", + " for s3 in seeds3:\n", + " if s3[1] == s2[0] and s3[2] == s4[3] and s3[4] == s2[5] and s3[5] == s4[1]:\n", + " transdict = {f: t for f, t in zip(ctu4 + ctu2 + ctu3, s4 + s2 + s3)}\n", + " if len(set(transdict.values())) == len(transdict):\n", + " print(ctu.translate(''.maketrans(transdict)))" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 28 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/cipher.py b/cipher.py index f291511..6cce725 100644 --- a/cipher.py +++ b/cipher.py @@ -451,7 +451,7 @@ def column_transposition_decipher(message, keyword, fillvalue=' ', 'hellothere' """ transpositions = transpositions_of(keyword) - message += pad(len(message), len(transpositions), '*') + message += pad(len(message), len(transpositions), fillvalue) if emptycolumnwise: rows = every_nth(message, len(message) // len(transpositions)) else: @@ -507,8 +507,21 @@ def scytale_decipher(message, rows): fillcolumnwise=True, emptycolumnwise=False) -def railfence_encipher(message, height, fillvalue=' '): - """Railfence cipher +def railfence_encipher(message, height, fillvalue=''): + """Railfence cipher. + Works by splitting the text into sections, then reading across them to + generate the rows in the cipher. The rows are then combined to form the + ciphertext. + + Example: the plaintext "hellotherefriends", with a height of four, written + out in the railfence as + h h i + etere* + lorfns + l e d + (with the * showing the one character to finish the last section). + Each 'section' is two columns, but unfolded. In the example, the first + section is 'hellot'. >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 2, fillvalue='!') 'hlohraateerishsslnpeefetotsigaleccpeselteevsmhatetiiaogicotxfretnrifneihr!' @@ -518,19 +531,57 @@ def railfence_encipher(message, height, fillvalue=' '): 'hresleogcseeemhetaocofrnrner!!lhateihsnefttiaece!!ltvsatiigitxetifih!!oarspeslp!' >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 10, fillvalue='!') 'hepisehagitnr!!lernesge!!lmtocerh!!otiletap!!tseaorii!!hassfolc!!evtitffe!!rahsetec!!eixn!' + >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 3) + 'horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihrlhateihsnefttiaece' + >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 5) + 'hresleogcseeemhetaocofrnrnerlhateihsnefttiaeceltvsatiigitxetifihoarspeslp' + >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 7) + 'haspolsevsetgifrifrlatihnettaeelemtiocxernhorersleesgcptehaiaottneihesfic' """ sections = chunks(message, (height - 1) * 2, fillvalue=fillvalue) + n_sections = len(sections) # Add the top row - rows = [s[0] for s in sections] + rows = [''.join([s[0] for s in sections])] # process the middle rows of the grid - for r in range(1, height - 1): - rows += [s[r] + s[-r] for s in sections] + for r in range(1, height-1): + rows += [''.join([s[r:r+1] + s[height*2-r-2:height*2-r-1] for s in sections])] # process the bottom row - rows += [s[height - 1] for s in sections] + rows += [''.join([s[height - 1:height] for s in sections])] + # rows += [' '.join([s[height - 1] for s in sections])] return ''.join(rows) -def railfence_decipher(message, height): - """Railfence decipher. Assumes the message is already the correct length. +def railfence_decipher(message, height, fillvalue=''): + """Railfence decipher. + Works by reconstructing the grid used to generate the ciphertext, then + unfolding the sections so the text can be concatenated together. + + Example: given the ciphertext 'hhieterelorfnsled' and a height of 4, first + work out that the second row has a character missing, find the rows of the + grid, then split the section into its two columns. + + 'hhieterelorfnsled' is split into + h h i + etere + lorfns + l e d + (spaces added for clarity), which is stored in 'rows'. This is then split + into 'down_rows' and 'up_rows': + + down_rows: + hhi + eee + lrn + led + + up_rows: + tr + ofs + + These are then zipped together (after the up_rows are reversed) to recover + the plaintext. + + Most of the procedure is about finding the correct lengths for each row then + splitting the ciphertext into those rows. >>> railfence_decipher('hlohraateerishsslnpeefetotsigaleccpeselteevsmhatetiiaogicotxfretnrifneihr!', 2).strip('!') 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers' @@ -540,17 +591,43 @@ def railfence_decipher(message, height): 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers' >>> railfence_decipher('hepisehagitnr!!lernesge!!lmtocerh!!otiletap!!tseaorii!!hassfolc!!evtitffe!!rahsetec!!eixn!', 10).strip('!') 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers' + >>> railfence_decipher('horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihrlhateihsnefttiaece', 3) + 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers' + >>> railfence_decipher('hresleogcseeemhetaocofrnrnerlhateihsnefttiaeceltvsatiigitxetifihoarspeslp', 5) + 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers' + >>> railfence_decipher('haspolsevsetgifrifrlatihnettaeelemtiocxernhorersleesgcptehaiaottneihesfic', 7) + 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers' """ - n_secs = len(message) // ((height - 1) * 2) - downrows = [message[:n_secs]] - uprows = [] - for r in range(height-2): - midrow = message[(2 * r + 1) * n_secs:(2 * r + 1) * n_secs + n_secs * 2] - downrows += [''.join([midrow[i] for i in range(0, len(midrow), 2)])] - uprows = [''.join([midrow[i] for i in range(1, len(midrow), 2)])] + uprows - downrows += [message[-n_secs:]] - rows = downrows + uprows - return ''.join(letter for section in zip(*rows) for letter in section) + # find the number and size of the sections, including how many characters + # are missing for a full grid + n_sections = math.ceil(len(message) / ((height - 1) * 2)) + padding_to_add = n_sections * (height - 1) * 2 - len(message) + # row_lengths are for the both up rows and down rows + row_lengths = [n_sections] * (height - 1) * 2 + for i in range((height - 1) * 2 - 1, (height - 1) * 2 - (padding_to_add + 1), -1): + row_lengths[i] -= 1 + # folded_rows are the combined row lengths in the middle of the railfence + folded_row_lengths = [row_lengths[0]] + for i in range(1, height-1): + folded_row_lengths += [row_lengths[i] + row_lengths[-i]] + folded_row_lengths += [row_lengths[height - 1]] + # find the rows that form the railfence grid + rows = [] + row_start = 0 + for i in folded_row_lengths: + rows += [message[row_start:row_start + i]] + row_start += i + # split the rows into the 'down_rows' (those that form the first column of + # a section) and the 'up_rows' (those that ofrm the second column of a + # section). + down_rows = [rows[0]] + up_rows = [] + for i in range(1, height-1): + down_rows += [''.join([c for n, c in enumerate(rows[i]) if n % 2 == 0])] + up_rows += [''.join([c for n, c in enumerate(rows[i]) if n % 2 == 1])] + down_rows += [rows[-1]] + up_rows.reverse() + return ''.join(c for r in zip_longest(*(down_rows + up_rows), fillvalue='') for c in r) class PocketEnigma(object): diff --git a/cipherbreak.py b/cipherbreak.py index 6f4d2ae..e563b81 100644 --- a/cipherbreak.py +++ b/cipherbreak.py @@ -445,26 +445,13 @@ def railfence_break(message, max_key_length=20, plaintext = railfence_decipher(message, height) fit = fitness(plaintext) return height, fit + sanitised_message = sanitise(message) results = starmap(worker, [(sanitised_message, i, fitness) for i in range(2, max_key_length+1)]) return max(results, key=lambda k: k[1]) - with Pool() as pool: - helper_args = [(message, trans, False, True, fitness) - for trans in - [[col for col in range(math.ceil(len(message)/rows))] - for rows in range(1,max_key_length+1)]] - # Gotcha: the helper function here needs to be defined at the top level - # (limitation of Pool.starmap) - breaks = pool.starmap(column_transposition_break_worker, - helper_args, chunksize) - best = max(breaks, key=lambda k: k[1]) - return math.trunc(len(message) / len(best[0][0])), best[1] -scytale_break = scytale_break_mp - - def pocket_enigma_break_by_crib(message, wheel_spec, crib, crib_position): """Break a pocket enigma using a crib (some plaintext that's expected to be in a certain position). Returns a list of possible starting wheel diff --git a/railfence-experiment-1.ipynb b/railfence-experiment-1.ipynb new file mode 100644 index 0000000..cf432ee --- /dev/null +++ b/railfence-experiment-1.ipynb @@ -0,0 +1,1085 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:c4879f550d49d776eff31ee9f3296756aab1dcd81e1e5aad61ade46d9b29600d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from cipher import *" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_encipherl('hellothere', 3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 25, + "text": [ + "'horeltee lh '" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "message = 'hellothere'\n", + "height = 2" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 169 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "sections = chunks(message, (height - 1) * 2, fillvalue='!')\n", + "sections" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 170, + "text": [ + "['he', 'll', 'ot', 'he', 're']" + ] + } + ], + "prompt_number": 170 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rows = [s[0] for s in sections]\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 171, + "text": [ + "['h', 'l', 'o', 'h', 'r']" + ] + } + ], + "prompt_number": 171 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for r in range(1, height - 1):\n", + " rows += [s[r] + s[-r] for s in sections]\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 172, + "text": [ + "['h', 'l', 'o', 'h', 'r']" + ] + } + ], + "prompt_number": 172 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rows += [s[height - 1] for s in sections]\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 173, + "text": [ + "['h', 'l', 'o', 'h', 'r', 'e', 'l', 't', 'e', 'e']" + ] + } + ], + "prompt_number": 173 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext = ''.join(rows)\n", + "ciphertext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 174, + "text": [ + "'hlohreltee'" + ] + } + ], + "prompt_number": 174 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def railfence_encipherl(message, height, fillvalue=' '):\n", + " \"\"\"Railfence cipher\n", + " \"\"\"\n", + " sections = chunks(message, (height - 1) * 2, fillvalue=fillvalue)\n", + " # Add the top row\n", + " rows = [s[0] for s in sections]\n", + " # process the middle rows of the grid\n", + " for r in range(1, height - 1):\n", + " rows += [s[r] + s[-r] for s in sections]\n", + " # process the bottom row\n", + " rows += [s[height - 1] for s in sections]\n", + " return ''.join(rows)" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 24 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext = railfence_encipherl(message, height, fillvalue='!')\n", + "ciphertext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 175, + "text": [ + "'hlohreltee'" + ] + } + ], + "prompt_number": 175 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "len(ciphertext)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 176, + "text": [ + "10" + ] + } + ], + "prompt_number": 176 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "n_secs = len(ciphertext) // ((height - 1) * 2)\n", + "n_secs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 177, + "text": [ + "5" + ] + } + ], + "prompt_number": 177 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext[:5]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 109, + "text": [ + "'hhaes'" + ] + } + ], + "prompt_number": 109 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext[5:15]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 110, + "text": [ + "'etevshae!!'" + ] + } + ], + "prompt_number": 110 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext[15:25]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 111, + "text": [ + "'lorateri!!'" + ] + } + ], + "prompt_number": 111 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext[25:]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 112, + "text": [ + "'lemt!'" + ] + } + ], + "prompt_number": 112 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "downrows = [ciphertext[:n_secs]]\n", + "uprows = []\n", + "downrows, uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 180, + "text": [ + "(['hlohr'], [])" + ] + } + ], + "prompt_number": 180 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for r in range(1, height, 2):\n", + " midrow = ciphertext[r * n_secs:(r+2)*n_secs]\n", + " downrows += [''.join([midrow[i] for i in range(0, len(midrow), 2)])]\n", + " uprows = [''.join([midrow[i] for i in range(1, len(midrow), 2)])] + uprows\n", + "downrows, uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 179, + "text": [ + "(['hlohr', 'ete'], ['le'])" + ] + } + ], + "prompt_number": 179 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "downrows += [ciphertext[-n_secs:]]\n", + "downrows, uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 181, + "text": [ + "(['hlohr', 'eltee'], [])" + ] + } + ], + "prompt_number": 181 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rows = downrows + uprows\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 182, + "text": [ + "['hlohr', 'eltee']" + ] + } + ], + "prompt_number": 182 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "midrow = rows[1]\n", + "midrow" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 64, + "text": [ + "'elteevsmhate!!'" + ] + } + ], + "prompt_number": 64 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "mid_down = ''.join([midrow[i] for i in range(0, len(midrow), 2)])\n", + "mid_down" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 65, + "text": [ + "'etesht!'" + ] + } + ], + "prompt_number": 65 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "mid_up = ''.join([midrow[i] for i in range(1, len(midrow), 2)])\n", + "mid_up" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 66, + "text": [ + "'levmae!'" + ] + } + ], + "prompt_number": 66 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rows = downrows + uprows\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 139, + "text": [ + "['hhaesspfoilcs',\n", + " 'eesataitrnfi!',\n", + " 'lrtrhleetgep!',\n", + " 'lemtiocxernh!',\n", + " 'oaeisnetsace!',\n", + " 'tvheigoftier!']" + ] + } + ], + "prompt_number": 139 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "''.join(letter for section in zip(*rows) for letter in section)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 183, + "text": [ + "'hellothere'" + ] + } + ], + "prompt_number": 183 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def railfence_decipherl(message, height):\n", + " n_secs = len(message) // ((height - 1) * 2)\n", + " downrows = [message[:n_secs]]\n", + " uprows = []\n", + " for r in range(height-2):\n", + " midrow = ciphertext[(2 * r + 1) * n_secs:(2 * r + 1) * n_secs + n_secs * 2]\n", + " downrows += [''.join([midrow[i] for i in range(0, len(midrow), 2)])]\n", + " uprows = [''.join([midrow[i] for i in range(1, len(midrow), 2)])] + uprows\n", + " downrows += [message[-n_secs:]]\n", + " rows = downrows + uprows\n", + " return ''.join(letter for section in zip(*rows) for letter in section)" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 249 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 154, + "text": [ + "'hhaesetevshae!!lorateri!!lemt!'" + ] + } + ], + "prompt_number": 154 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_decipherl(ciphertext, 4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 155, + "text": [ + "''" + ] + } + ], + "prompt_number": 155 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "plaintext = sanitise('hello there avast me hearties this is a long piece of text for testing railfence ciphers')\n", + "plaintext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 250, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers'" + ] + } + ], + "prompt_number": 250 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext = railfence_encipherl(plaintext, height, fillvalue='!')\n", + "ciphertext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 163, + "text": [ + "'hhaesspfoilcsetevshaetiagiotfrtnifeir!!loraterihslneeettsgaecpe!!lemtiocxernh!'" + ] + } + ], + "prompt_number": 163 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_decipherl(ciphertext, height)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 164, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers!!!!!'" + ] + } + ], + "prompt_number": 164 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_encipherl('hellothere', 2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 186, + "text": [ + "'hlohreltee'" + ] + } + ], + "prompt_number": 186 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_decipherl('hlohreltee', 2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 187, + "text": [ + "'hellothere'" + ] + } + ], + "prompt_number": 187 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "[i for i in range(1, 2, 2)]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 184, + "text": [ + "[1]" + ] + } + ], + "prompt_number": 184 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_encipherl('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 10, fillvalue='!')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 265, + "text": [ + "'hepisehagitnr!!lernesge!!lmtocerh!!otiletap!!tseaorii!!hassfolc!!evtitffe!!rahsetec!!eixn!'" + ] + } + ], + "prompt_number": 265 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_decipherl('horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihr!!lhateihsnefttiaece!', 3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 191, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers!!!'" + ] + } + ], + "prompt_number": 191 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_encipherl('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 4, fillvalue='!')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 240, + "text": [ + "'hhaesspfoilcsetevshaetiagiotfrtnifeir!!loraterihslneeettsgaecpe!!lemtiocxernh!'" + ] + } + ], + "prompt_number": 240 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_decipherl('hhaesspfoilcsetevshaetiagiotfrtnifeir!!loraterihslneeettsgaecpe!!lemtiocxernh!', 4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 241, + "text": [ + "'hmelfhhetettaaimaoecetcosfei!rsn!olrpntcvefrsxa!o!teilihirgaltintecixhehsst!in'" + ] + } + ], + "prompt_number": 241 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_encipherl('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 5, fillvalue='!')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 238, + "text": [ + "'hresleogcseeemhetaocofrnrner!!lhateihsnefttiaece!!ltvsatiigitxetifih!!oarspeslp!'" + ] + } + ], + "prompt_number": 238 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "railfence_decipherl('hresleogcseeemhetaocofrnrner!!lhateihsnefttiaece!!ltvsatiigitxetifih!!oarspeslp!', 5)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 239, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers!!!!!!!'" + ] + } + ], + "prompt_number": 239 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "len(railfence_encipherl('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 5, fillvalue='!'))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 199, + "text": [ + "80" + ] + } + ], + "prompt_number": 199 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext = 'horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihr!!lhateihsnefttiaece!'\n", + "height=3" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 226 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext = 'hhaesspfoilcsetevshaetiagiotfrtnifeir!!loraterihslneeettsgaecpe!!lemtiocxernh!'\n", + "height=4" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 242 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext = 'hresleogcseeemhetaocofrnrner!!lhateihsnefttiaece!!ltvsatiigitxetifih!!oarspeslp!'\n", + "height=5" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 226 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "n_secs = len(ciphertext) // ((height - 1) * 2)\n", + "n_secs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 243, + "text": [ + "13" + ] + } + ], + "prompt_number": 243 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "downrows = [ciphertext[:n_secs]]\n", + "uprows = []\n", + "downrows, uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 244, + "text": [ + "(['hhaesspfoilcs'], [])" + ] + } + ], + "prompt_number": 244 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for r in range(height-2):\n", + " print('From', (2 * r + 1) * n_secs, 'to', (2 * r + 1) * n_secs + n_secs * 2)\n", + " midrow = ciphertext[(2 * r + 1) * n_secs:(2 * r + 1) * n_secs + n_secs * 2]\n", + " downrows += [''.join([midrow[i] for i in range(0, len(midrow), 2)])]\n", + " uprows = [''.join([midrow[i] for i in range(1, len(midrow), 2)])] + uprows\n", + "downrows, uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From 13 to 39\n", + "From 39 to 65\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 245, + "text": [ + "(['hhaesspfoilcs', 'eesataitrnfi!', 'lrtrhleetgep!'],\n", + " ['oaeisnetsace!', 'tvheigoftier!'])" + ] + } + ], + "prompt_number": 245 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "downrows += [ciphertext[-n_secs:]]\n", + "downrows, uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 246, + "text": [ + "(['hhaesspfoilcs', 'eesataitrnfi!', 'lrtrhleetgep!', 'lemtiocxernh!'],\n", + " ['oaeisnetsace!', 'tvheigoftier!'])" + ] + } + ], + "prompt_number": 246 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rows = downrows + uprows" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 247 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "''.join(letter for section in zip(*rows) for letter in section)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 248, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers!!!!!'" + ] + } + ], + "prompt_number": 248 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "[i for i in range(0)]" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 236, + "text": [ + "[]" + ] + } + ], + "prompt_number": 236 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "height = 3\n", + "ciphertext = railfence_encipherl(plaintext, height, fillvalue=' ')\n", + "result = railfence_decipherl(ciphertext, height).strip()\n", + "result == plaintext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 270, + "text": [ + "True" + ] + } + ], + "prompt_number": 270 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ciphertext" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 271, + "text": [ + "'horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihr lhateihsnefttiaece '" + ] + } + ], + "prompt_number": 271 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/railfence-experiment-2.ipynb b/railfence-experiment-2.ipynb new file mode 100644 index 0000000..be34da0 --- /dev/null +++ b/railfence-experiment-2.ipynb @@ -0,0 +1,725 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:285f7a82eaf5cc815e9a686ebce8aa2cfbdecb14f2473c9b5dfe0aedafcd727c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from cipher import *\n", + "from cipherbreak import *\n", + "import math" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 79 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def railfence_encipher(message, height, fillvalue=' '):\n", + " \"\"\"Railfence cipher\n", + "\n", + " >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 2, fillvalue='!')\n", + " 'hlohraateerishsslnpeefetotsigaleccpeselteevsmhatetiiaogicotxfretnrifneihr!'\n", + " >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 3, fillvalue='!')\n", + " 'horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihr!!lhateihsnefttiaece!'\n", + " >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 5, fillvalue='!')\n", + " 'hresleogcseeemhetaocofrnrner!!lhateihsnefttiaece!!ltvsatiigitxetifih!!oarspeslp!'\n", + " >>> railfence_encipher('hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers', 10, fillvalue='!')\n", + " 'hepisehagitnr!!lernesge!!lmtocerh!!otiletap!!tseaorii!!hassfolc!!evtitffe!!rahsetec!!eixn!'\n", + " \"\"\"\n", + " sections = chunks(message, (height - 1) * 2, fillvalue=fillvalue)\n", + " # Add the top row\n", + " rows = [s[0] for s in sections]\n", + " # process the middle rows of the grid\n", + " for r in range(1, height - 1):\n", + " rows += [s[r] + s[-r] for s in sections]\n", + " # process the bottom row\n", + " rows += [s[height - 1] for s in sections]\n", + " return ''.join(rows)" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 2 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "pt = 'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers'\n", + "height = 6" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 195 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "sections = chunks(pt, (height - 1) * 2, fillvalue='!')\n", + "n_sections = len(sections)\n", + "# Add the top row\n", + "rows = [' '.join([s[0] for s in sections])]\n", + "# process the middle rows of the grid\n", + "for r in range(1, height - 1):\n", + " # rows += [''.join([s[r:r+1] + s[n_sections-r:n_sections-r+1] for s in sections])]\n", + " rows += [''.join([s[r] + s[-r] for s in sections])]\n", + "# process the bottom row\n", + "# rows += [' '.join([s[height - 1:height] for s in sections])]\n", + "rows += [' '.join([s[height - 1] for s in sections])]\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 196, + "text": [ + "['h a r s e t l e',\n", + " 'eevatiacoreifhr!',\n", + " 'lraeislefosaeps!',\n", + " 'lesheioitftrni!!',\n", + " 'ohteshnpetigcc!!',\n", + " 't m t g x n e !']" + ] + } + ], + "prompt_number": 196 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "sections" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 197, + "text": [ + "['hellothere',\n", + " 'avastmehea',\n", + " 'rtiesthisi',\n", + " 'salongpiec',\n", + " 'eoftextfor',\n", + " 'testingrai',\n", + " 'lfenceciph',\n", + " 'ers!!!!!!!']" + ] + } + ], + "prompt_number": 197 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "sections = chunks(pt, (height - 1) * 2, fillvalue='')\n", + "# Add the top row\n", + "rows = [' '.join([s[0] for s in sections])]\n", + "# process the middle rows of the grid\n", + "for r in range(1, height-1):\n", + " print(r, height*2-r-2, ':', sections[0][r:r+1], sections[0][height*2-r-2:height*2-r-1])\n", + " rows += [''.join([s[r:r+1] + s[height*2-r-2:height*2-r-1] for s in sections])]\n", + " # rows += [''.join([s[r] + s[-r] for s in sections])]\n", + "# process the bottom row\n", + "rows += [' '.join([s[height - 1:height] for s in sections])]\n", + "# rows += [' '.join([s[height - 1] for s in sections])]\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1 9 : e e\n", + "2 8 : l r\n", + "3 7 : l e\n", + "4 6 : o h\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 198, + "text": [ + "['h a r s e t l e',\n", + " 'eevatiacoreifhr',\n", + " 'lraeislefosaeps',\n", + " 'lesheioitftrni',\n", + " 'ohteshnpetigcc',\n", + " 't m t g x n e ']" + ] + } + ], + "prompt_number": 198 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "sections" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 199, + "text": [ + "['hellothere',\n", + " 'avastmehea',\n", + " 'rtiesthisi',\n", + " 'salongpiec',\n", + " 'eoftextfor',\n", + " 'testingrai',\n", + " 'lfenceciph',\n", + " 'ers']" + ] + } + ], + "prompt_number": 199 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ct = ''.join(c for c in ''.join(rows) if c != ' ')\n", + "ct" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 200, + "text": [ + "'harsetleeevatiacoreifhrlraeislefosaepslesheioitftrniohteshnpetigcctmtgxne'" + ] + } + ], + "prompt_number": 200 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "n_sections = math.ceil(len(pt) / ((height - 1) * 2))\n", + "n_sections" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 202, + "text": [ + "8" + ] + } + ], + "prompt_number": 202 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "padding_to_add = n_sections * (height - 1) * 2 - len(pt)\n", + "padding_to_add" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 203, + "text": [ + "7" + ] + } + ], + "prompt_number": 203 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "row_lengths = [n_sections] * (height - 1) * 2\n", + "row_lengths" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 204, + "text": [ + "[8, 8, 8, 8, 8, 8, 8, 8, 8, 8]" + ] + } + ], + "prompt_number": 204 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for i in range((height - 1) * 2 - 1, (height - 1) * 2 - (padding_to_add + 1), -1):\n", + " row_lengths[i] -= 1\n", + "row_lengths" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 205, + "text": [ + "[8, 8, 8, 7, 7, 7, 7, 7, 7, 7]" + ] + } + ], + "prompt_number": 205 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "folded_row_lengths = [row_lengths[0]]\n", + "for i in range(1, height-1):\n", + " folded_row_lengths += [row_lengths[i] + row_lengths[-i]]\n", + "folded_row_lengths += [row_lengths[height - 1]]\n", + "folded_row_lengths" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 206, + "text": [ + "[8, 15, 15, 14, 14, 7]" + ] + } + ], + "prompt_number": 206 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rows = []\n", + "row_start = 0\n", + "for i in folded_row_lengths:\n", + " rows += [ct[row_start:row_start + i]]\n", + " row_start += i\n", + "rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 207, + "text": [ + "['harsetle',\n", + " 'eevatiacoreifhr',\n", + " 'lraeislefosaeps',\n", + " 'lesheioitftrni',\n", + " 'ohteshnpetigcc',\n", + " 'tmtgxne']" + ] + } + ], + "prompt_number": 207 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "down_rows = [rows[0]]\n", + "up_rows = []\n", + "for i in range(1, height-1):\n", + " down_rows += [''.join([c for n, c in enumerate(rows[i]) if n % 2 == 0])]\n", + " up_rows += [''.join([c for n, c in enumerate(rows[i]) if n % 2 == 1])]\n", + "down_rows += [rows[-1]]\n", + "down_rows, up_rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 208, + "text": [ + "(['harsetle', 'evtaoefr', 'lailfses', 'lseottn', 'otsneic', 'tmtgxne'],\n", + " ['eaicrih', 'reseoap', 'ehiifri', 'hehptgc'])" + ] + } + ], + "prompt_number": 208 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "up_rows.reverse()\n", + "down_rows + up_rows" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 164, + "text": [ + "['hresleogcs',\n", + " 'eehtoorre',\n", + " 'laehnftac',\n", + " 'lvaigteii',\n", + " 'oarspeslp',\n", + " 'tstiixtfh',\n", + " 'htisetiee',\n", + " 'emeacfnnr']" + ] + } + ], + "prompt_number": 164 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "''.join(c for r in zip_longest(*(down_rows + up_rows), fillvalue='') for c in r)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 165, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers'" + ] + } + ], + "prompt_number": 165 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def rfe(message, height, fillvalue=''):\n", + " sections = chunks(message, (height - 1) * 2, fillvalue=fillvalue)\n", + " n_sections = len(sections)\n", + " # Add the top row\n", + " rows = [''.join([s[0] for s in sections])]\n", + " # process the middle rows of the grid\n", + " for r in range(1, height-1):\n", + " rows += [''.join([s[r:r+1] + s[height*2-r-2:height*2-r-1] for s in sections])]\n", + " # process the bottom row\n", + " rows += [''.join([s[height - 1:height] for s in sections])]\n", + " # rows += [' '.join([s[height - 1] for s in sections])]\n", + " return ''.join(rows)" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 171 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rfe(pt, 5)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 177, + "text": [ + "'hresleogcseeemhetaocofrnrnerlhateihsnefttiaeceltvsatiigitxetifihoarspeslp'" + ] + } + ], + "prompt_number": 177 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rfe(pt, 5) == ct" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 178, + "text": [ + "True" + ] + } + ], + "prompt_number": 178 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def rfd(message, height, fillvalue=''):\n", + " n_sections = math.ceil(len(message) / ((height - 1) * 2))\n", + " padding_to_add = n_sections * (height - 1) * 2 - len(message)\n", + " row_lengths = [n_sections] * (height - 1) * 2\n", + " for i in range((height - 1) * 2 - 1, (height - 1) * 2 - (padding_to_add + 1), -1):\n", + " row_lengths[i] -= 1\n", + " folded_row_lengths = [row_lengths[0]]\n", + " for i in range(1, height-1):\n", + " folded_row_lengths += [row_lengths[i] + row_lengths[-i]]\n", + " folded_row_lengths += [row_lengths[height - 1]]\n", + " rows = []\n", + " row_start = 0\n", + " for i in folded_row_lengths:\n", + " rows += [message[row_start:row_start + i]]\n", + " row_start += i\n", + " down_rows = [rows[0]]\n", + " up_rows = []\n", + " for i in range(1, height-1):\n", + " down_rows += [''.join([c for n, c in enumerate(rows[i]) if n % 2 == 0])]\n", + " up_rows += [''.join([c for n, c in enumerate(rows[i]) if n % 2 == 1])]\n", + " down_rows += [rows[-1]]\n", + " up_rows.reverse()\n", + " return ''.join(c for r in zip_longest(*(down_rows + up_rows), fillvalue='') for c in r)" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 220 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "h = 7\n", + "print(rfe(pt, h))\n", + "rfd(rfe(pt, h), h)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "haspolsevsetgifrifrlatihnettaeelemtiocxernhorersleesgcptehaiaottneihesfic\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 221, + "text": [ + "'hellothereavastmeheartiesthisisalongpieceoftextfortestingrailfenceciphers'" + ] + } + ], + "prompt_number": 221 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for h in range(2, 51):\n", + " assert rfd(rfe(pt, h), h) == pt\n", + " print(h, ':', rfd(rfe(pt, h), h) == pt)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "2 : True\n", + "3 : True\n", + "4 : True\n", + "5 : True\n", + "6 : True\n", + "7 : True\n", + "8 : True\n", + "9 : True\n", + "10 : True\n", + "11 : True\n", + "12 : True\n", + "13 : True\n", + "14 : True\n", + "15 : True\n", + "16 : True\n", + "17 : True\n", + "18 : True\n", + "19 : True\n", + "20 : True\n", + "21 : True\n", + "22 : True\n", + "23 : True\n", + "24 : True\n", + "25 : True\n", + "26 : True\n", + "27 : True\n", + "28 : True\n", + "29 : True\n", + "30 : True\n", + "31 : True\n", + "32 : True\n", + "33 : True\n", + "34 : True\n", + "35 : True\n", + "36 : True\n", + "37 : True\n", + "38 : True\n", + "39 : True\n", + "40 : True\n", + "41 : True\n", + "42 : True\n", + "43 : True\n", + "44 : True\n", + "45 : True\n", + "46 : True\n", + "47 : True\n", + "48 : True\n", + "49 : True\n", + "50 : True\n" + ] + } + ], + "prompt_number": 227 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "h" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 224, + "text": [ + "1" + ] + } + ], + "prompt_number": 224 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rfe('hellotherefriends', 4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 228, + "text": [ + "'hhieterelorfnsled'" + ] + } + ], + "prompt_number": 228 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "rfd('hhieterelorfnsled', 4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 229, + "text": [ + "'hellotherefriends'" + ] + } + ], + "prompt_number": 229 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "for h in [3, 5, 7]:\n", + " print(rfe(pt, h))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "horaersslpeeosglcpselteevsmhatetiiaogicotxfretnrifneihrlhateihsnefttiaece\n", + "hresleogcseeemhetaocofrnrnerlhateihsnefttiaeceltvsatiigitxetifihoarspeslp\n", + "haspolsevsetgifrifrlatihnettaeelemtiocxernhorersleesgcptehaiaottneihesfic\n" + ] + } + ], + "prompt_number": 230 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file