From cd593f7023cdc865b0d7436b19923b995ee37340 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Fri, 4 Jan 2019 22:25:05 +0000 Subject: [PATCH] Done 2018 challenge 10 --- 2018/2018-challenge9.ipynb | 95 +- 2018/2018-challengea.ipynb | 2031 ++++++++++++++++++++++++++++++++++++ 2018/aa.ciphertext | 1 + 2018/aa.plaintext | 57 + 2018/ab.ciphertext | 5 + 2018/ab.plaintext | 5 + 6 files changed, 2125 insertions(+), 69 deletions(-) create mode 100644 2018/2018-challengea.ipynb create mode 100644 2018/aa.ciphertext create mode 100644 2018/aa.plaintext create mode 100644 2018/ab.ciphertext create mode 100644 2018/ab.plaintext diff --git a/2018/2018-challenge9.ipynb b/2018/2018-challenge9.ipynb index d386b62..ebf6dd6 100644 --- a/2018/2018-challenge9.ipynb +++ b/2018/2018-challenge9.ipynb @@ -37,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -60,7 +60,7 @@ "8197" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -72,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -121,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -130,7 +130,7 @@ "'dynamite'" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -142,7 +142,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -151,7 +151,7 @@ "'theengineersharrybroughtwithhimwantedtotakesawsandtorchestothetablesafebutneitherofuswerekeenicouldseethatitwouldbeworthalottocollectorsandprobablybelongedinamuseumharrysaidheagreedbutihadafeelinghewanteditinstalledbackinheadquarterstherewassomethingproprietorialinthewayhelookedatitittookthetwoofuseighteenhourstocrackitbutwithasquadronofspecialforcesfromherefordguardingustherewasnoriskthatmyattackerswouldreturniaskedharryhowhegotauthorisationtobringtheminafterallwestillwerentsurethattherewereanynationalsecurityimplicationsbuthejustlaughedandpointedoutthatwewerecurrentlysomewhereundernewscotlandyardandithadnttakenmuchtoconvincethehomesecretarythatweneededapropersecurityteamtoguardtheshadowarchiveanotherteamofanalystshadcampedononesideofthecommandcentreandwerecombingthroughblackscodebookandthefewpapersthatourantagonistshadleftbehindfromtimetotimeoneofthetrooperswouldarrivewithanotherboxofdocumentsretrievedfromasideroomoramoredistantpartofthearchivelabyrinthmostcouldbedecryptedquicklyusingthestandardtoolsblackhadusedarangeofciphersincludingsubstitutionandtranspositionandalmostnoneofitwasharderthanavigenereitwasslowsincethepapershadtobehandledwithcareandthescannertheyhadbroughtwiththemwasntreallydesignedforthissortofworkacoupleoftimestheycalledharryovertoshowhimsomethingandhereaditnoddedthencamebacktoworkonthesafeasweworkedwetalkedaboutwhatihadlearnedconcerningtheshadowarchiveandblackssecretworkforthegovernmentharrydidntgivemuchawaybutihadafeelinghehadheardsomeofthisstorybeforeandafterthesecondtimehewascalledawayheseemedparticularlythoughtfuliaskedhimwhatwasbotheringhimbuthewasenjoyingbeingcryptichesaidsomethingaboutthebalkanproblemthenmutteredsteveturnerspoemhistorylessonhistoryrepeatsitselfhastonoonelistensicouldntgetanythingmoreoutofhimexceptsomecommentaboutworkingbackwardsthroughthepaperssoiturnedmyattentionbacktothesafethemechanismwasbiggerandheavierthanwewereusedtoandhadbeenexquisitelymadethecomponentsslidalmostnoiselesslyoveroneanotherandtheloudclicksihadheardwhenmovingthetableseemedtobetheresultofabrokencogtoothcatchingonthebarrelsthatmadeitevenhardertoopenwhatlittlenoisethelocktumblersmadewasheavilydisguisedandwehadtoresorttodrillingasmallaccessholetopassanendoscopeintotheinterioritwasaswellwehadtakentheeffortsittinginthemiddleofapileofnotebooksandpaperswasasmallpileofwhatlookedlikeexplosivesthesafewasriggedtoblowifwemadeamistake'" ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -162,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -203,12 +203,12 @@ } ], "source": [ - "print(lcat(tpack(segment(vigenere_decipher(sca, key_a)))))" + "print(prettify(vigenere_decipher(sca, key_a)))" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -217,13 +217,13 @@ "2913" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "open('9a.plaintext', 'w').write(lcat(tpack(segment(vigenere_decipher(sca, key_a)))))" + "open('9a.plaintext', 'w').write(prettify(vigenere_decipher(sca, key_a)))" ] }, { @@ -235,30 +235,7 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAAEmCAYAAAADccV0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFE1JREFUeJzt3X+QZWV95/H3J2CMogkCLSHK2OISN5rEUUYSo6SIP7JoNOquMRB/kZiMbKBMdtekIG4iRcUqEjXWbu0GM8QpcEMQDUFJxCiFRvAH0RkYYfglIMPC1GQYIasCCQLz3T/umeTO0NDn/pqep/v9qro15zz3PPf5dp/u/pzn3HPPpKqQJKk137fUBUiSNA4DTJLUJANMktQkA0yS1CQDTJLUJANMktQkA0yS1CQDTJLUJANMktQkA0yS1KT9l7oAgEMOOaTm5+eXugxJ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XKSl1bV5xYZ73sZXHD2/6rq4Sl8CWNb9nfi6I5KrqqqkY/QMrhC796qev/UC5tAknngb6vqMa8YkvZ1SZ5UVfd2V2NeDqytqquWui49uu6g4Srgl6rq5qWsZVmfQuxOvXyFwVU2kvY967oLMa4CLjS89m1JnsPgKt/Lljq8YAXMwCRJy9OynoFJkpYvA0yS1CQDTJLUJANMktQkA0yS1CQDTJLUpP8PmF7b9IIW3PUAAAAASUVORK5CYII=\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "fc = collections.Counter(scb)\n", - "plot_frequency_histogram(fc, sort_key=fc.get)" - ] - }, - { - "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -267,7 +244,7 @@ "'turkey'" ] }, - "execution_count": 12, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -279,7 +256,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -288,40 +265,19 @@ "'erutuferuceseromdnawenagnitaercfoepohehtnimehthtiwylesolckrowoteunitnoclliwinoigertahtnidlohtoofasueviglliwainsobnikrowtentnegaruoosfiyltnenamrepnoitseuqnaklabehtelttesotspahrepdnasniaglairotirretnaissurenimrednuotepohewetatsnamottoehtotkcabainodecamgnidartybemitemasehttasetuoredartnaenarretidemehtfolortnocruognitnemecsurpycniagyamewtahtsruomurdraehevahidnaseitinutroppognidartnihcireblliwynamregniraazabcitamolpidehtfoerehpsomtadeiznerfehtesruocfosrewoprojamehtnomehthguorhtraeboterusserpgnirbnacewtahtepohehtniytilibatsniderutrunevahsnaklabehtssorcastnegaymseitrapdnasetatsrellamsehtnosisucofymtubweivaevaherusmailliwsrewoprojamehtfollassergnocehtfonrecnocelpicnirpehtsideveihcaebthgimnoitacifinusihtrehtehwdnawohfonoitseuqehtelbitapmocnieraesehtdnasweivlavirynamyreveraerehttahtrehtartubaediraelcakcalyehttahttonsitignidaelsimsitahtspahrepnoitacifinuehtdaeldluohsytraphcihwfoaediraelcondnanworiehtfosnoitibmalacitilopdnalarutlucdeiravhtiwdedividniamersevlesmehtsetatsnaklabehtnoitulosnaklabakeesohwesohtdnaaissurnihtiweildluohsrewopstifosucolehttahteveilebohwesohtneewtebtilpsylpeedsitubdeifinuneebevahylatidnaynamregtahtyawemasehtnisetatscivalsehtetinuotsmiatnemevomcivalsnapehtsisircehtfotuoyawaeesyameweveilebinehtnilrebtaadnegaehtlortnocnacewfitcilfnocrehtrufmorfesoloteromgnihtemosevahyehttahtdesilaerevahlladnatnenitnocehtssorcatpureyamrawtahttaerhtgnirehtagehteesotnugebevahsrewoprojamehtfollasevilnitsocrewolhcumatadeeccusthgimycamolpidfosdohtemwenruotahtsiepohymtsoctaergtanetfodnathguoberagninniwhtrowseirotcivllatahtweivymsititubthguorbnaemylerustsumitahtdiasdnaemdetcerrocehriafyalpotsihtdiasinehwnoituloserarofepohotnigebnacinilrebnissergnocgnidnepmiehttathguobebthgimecaeptahttcepsorpehthtiwyllanifwonnihtiwseimenegnithgifygreneelbaredisnocdednepxeevahidnallahetihwniralupopyllasrevinuneebtonevahsdohtemymsselehtenonmelborphsikrutehtotnoitulosnworuotneserpotsrewopgnidaelrehtohtiwetaitogenotnigebotelbaerewewdnocesdnaseimeneruofosecivrescitamolpidehtnihtiwkrowtentnegaruopolevedotelbaerewewtsrifsgnihtowtdeveihcayaledsihttahtflesymtrofmocidnaelbativeniehtyaledotdekrowseillaehtgnomanoisufnocgniwosfoygetartsruonoituloslanoitanretninaotelbanemaebotgniraeppaelihwnoitisophsitirbehtgnisilanigramylevitceffednaairtsuadnaynamregniseillarehhtiwnoitcaroftroppusgnidliubyltcefrepdnahrehdeyalpsahaissurderaefewtahtllaneebsahrawhsikrutossureht'" ] }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "b1 = vigenere_decipher(scb, key_b)\n", - "b1" - ] - }, - { - "cell_type": "code", - "execution_count": 33, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'therussoturkishwarhasbeenallthatwefearedrussiahasplayedherhandperfectlybuildingsupportforactionwithheralliesingermanyandaustriaandeffectivelymarginalisingthebritishpositionwhileappearingtobeamenabletoaninternationalsolutionourstrategyofsowingconfusionamongthealliesworkedtodelaytheinevitableandicomfortmyselfthatthisdelayachievedtwothingsfirstwewereabletodevelopouragentnetworkwithinthediplomaticservicesofourenemiesandsecondwewereabletobegintonegotiatewithotherleadingpowerstopresentourownsolutiontotheturkishproblemnonethelessmymethodshavenotbeenuniversallypopularinwhitehallandihaveexpendedconsiderableenergyfightingenemieswithinnowfinallywiththeprospectthatpeacemightbeboughtattheimpendingcongressinberlinicanbegintohopeforaresolutionwhenisaidthistoplayfairhecorrectedmeandsaidthatimustsurelymeanbroughtbutitismyviewthatallvictoriesworthwinningareboughtandoftenatgreatcostmyhopeisthatournewmethodsofdiplomacymightsucceedatamuchlowercostinlivesallofthemajorpowershavebeguntoseethegatheringthreatthatwarmayeruptacrossthecontinentandallhaverealisedthattheyhavesomethingmoretolosefromfurtherconflictifwecancontroltheagendaatberlinthenibelievewemayseeawayoutofthecrisisthepanslavicmovementaimstounitetheslavicstatesinthesamewaythatgermanyanditalyhavebeenunifiedbutisdeeplysplitbetweenthosewhobelievethatthelocusofitspowershouldliewithinrussiaandthosewhoseekabalkansolutionthebalkanstatesthemselvesremaindividedwithvariedculturalandpoliticalambitionsoftheirownandnoclearideaofwhichpartyshouldleadtheunificationperhapsthatismisleadingitisnotthattheylackaclearideabutratherthatthereareverymanyrivalviewsandtheseareincompatiblethequestionofhowandwhetherthisunificationmightbeachievedistheprincipleconcernofthecongressallofthemajorpowerswilliamsurehaveaviewbutmyfocusisonthesmallerstatesandpartiesmyagentsacrossthebalkanshavenurturedinstabilityinthehopethatwecanbringpressuretobearthroughthemonthemajorpowersofcoursethefrenziedatmosphereofthediplomaticbazaaringermanywillberichintradingopportunitiesandihaveheardrumoursthatwemaygaincypruscementingourcontrolofthemediterraneantraderoutesatthesametimebytradingmacedoniabacktotheottomanstatewehopetounderminerussianterritorialgainsandperhapstosettlethebalkanquestionpermanentlyifsoouragentnetworkinbosniawillgiveusafootholdinthatregioniwillcontinuetoworkcloselywiththeminthehopeofcreatinganewandmoresecurefuture'" - ] - }, - "execution_count": 33, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "pb = cat(reversed(b1))\n", - "pb" + "pb1 = vigenere_decipher(scb, key_b)\n", + "pb1" ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -362,12 +318,13 @@ } ], "source": [ - "print(lcat(tpack(segment(pb))))" + "rpb1 = cat(reversed(pb1))\n", + "print(prettify(rpb1))" ] }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -376,13 +333,13 @@ "2856" ] }, - "execution_count": 35, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "open('9b.plaintext', 'w').write(lcat(tpack(segment(pb))))" + "open('9b.plaintext', 'w').write(prettify(rpb1))" ] }, { diff --git a/2018/2018-challengea.ipynb b/2018/2018-challengea.ipynb new file mode 100644 index 0000000..4eb722d --- /dev/null +++ b/2018/2018-challengea.ipynb @@ -0,0 +1,2031 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Biolerplate" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os,sys,inspect\n", + "currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\n", + "parentdir = os.path.dirname(currentdir)\n", + "sys.path.insert(0,parentdir) " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "from cipher.caesar import *\n", + "from cipher.affine import *\n", + "from cipher.keyword_cipher import *\n", + "from cipher.vigenere import *\n", + "from cipher.playfair import *\n", + "from cipher.autokey import *\n", + "from cipher.column_transposition import *\n", + "from support.text_prettify import *\n", + "from support.plot_frequency_histogram import *" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "ca = open('aa.ciphertext').read()\n", + "cb = open('ab.ciphertext').read()\n", + "sca = ca.strip()\n", + "scb = sanitise(cb)\n", + "pcb = letters(cb)\n", + "ptb = depunctuate(cb)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8197" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "history_words = [w.strip() for w in open('history-words.txt')]\n", + "len(history_words)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "history_transpositions = collections.defaultdict(list)\n", + "for word in history_words:\n", + " history_transpositions[transpositions_of(word)] += [word]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Part A" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "22545" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(sca)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3220.714285714286" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(sca) / 7" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[8, 8, 4, 17, 15]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ca5c = [int(c, 2) for c in chunks(sca, 5)]\n", + "ca5c[:5]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(25, 0)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(ca5c), min(ca5c)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'iierpfblvnjgtbrdncqtncvrimuoccxprrvguebucboboejcfvyakcsqjajnsmgtpqvzrnfuupntycqtnnecebbccyjughvrbjyewmspvsfdgqpejmimfuxefageuufzrmftfbuedylmeseynmclrrfiadupjtytycsmvtnytrhskyterlcfflvdkfflrmfjjbvoeaiiegvubayieiflgorufjbfdcdpnnzabtqekmoigoiqbvqackpagaewpbueibjzrckgpvjoljepnvvbjaguizflntccbagoecpnghvkuprmraiqaeiwxifocbbvqtycticpvpterrvlupnpgwxwekzlhevtygujhtdcdpnnzabtzetfbvvsdqdiabvcbaveirpebrbujbutyyomyetrswaitqbalolabvfevfpervvpzbuieejapoelfkgeuykcqitgpcfdfqfwsslnfztllcgqkeukpagowrimzetfbvvsdqjvclrafrhskjfiiieevajikfuprpimctrmfdxpntkmewjikfbpragmgwydrlecaskyctreonmwfimctvbrdymtlwvupcydyywmclraflbnvmsbjofdpceonlemgoeyuwesrlexncbcewhtkffxyatcxqghjyoloaxqbvqbicfhrbcmdsftfapvgazlupreonmwfiflbvqikfjvxemcopnriwnqthkfbdrbvcokbnmgokrdkfbbghrrjajhrrxmfhfsmlqozlupvstytmouksonbrksoigecwupreonmwfimcterrvlpbghvmotltygoojetmvtqsvcjvfiucuprsrdfavtkgoohnucsbuedubanscgnjyaticwbkncdwhluluarerlzlrtrgmaoukfbdvnxepbghzqgieikqfmzeuasimykmemftimzqgaewupvnxriqfwvjmxeokcdbrddstbuamccmrnzkqwetrluigsfkfbvmvyoljeecflrdkmlvbwnfbbghzqnqthkymtuamccmrnrzpcgawrfznqlgdspacjcipkkmimndhsbzgeiqiierpepbnpgppdnlkmdwatzlvmgrpgoogotpbkxtyctiseyclvrwdcuwbwvjmbbajinmgoccbdrblruprdfavurnkqumnmicuzrakcebbajygmqijrbvpeumxvghvapzeiumsevtykpagowrimturpeayertjvtajkbtytvynbbwrrdpbvvpvansncxwekvbpvrowrimzhrbkwvnvbuprsrqgzbmkffanpgcsannuubannvvqmeivldmqbfkclvsgmtiyeonfzgsfffebrbceevtystenttfjvttycffclfqjdrswmsiaytfbvtejkpvvtfpjvtvzzsigiflbvqtvkqmeakssmnnuefvrrrjmgxevnjvtujabtzikrbsrsrqqmpirjumzpvpburnkrplbtyyuebrbdvtytzkfiadncxmeexjblbfkffkbmgyognnurimrxgcsbvsvygbrrjcwmatvcopbuiqxmjeichmgtzlhbvrvbbvqajcjoutvcoicpimbkueugcmtaerpebnucsqswvupcyddyoitekmtiiekffxnpvptjhtvtfvgurjmgghvdjvnltmhbhreceiadkfftnskrvuolvpgmylzluwclraferhrbniaaxcebbgcsfbuesppsrntmhjncbrportycsiadngupnmzjexeokctbghvrpxguilfleazqjvtagjbbsoikvxghimvoutycdmatiymxvlcysbbpictmatlqxqghkffjbobufpndjcfvoykfftvgyrpnghvcolbstmqmvtnytjngxceiadjcdceeuyoluaipzbbobguevtyfjughvqqmpirjgwecvqtmpuicebuevluznntctbbtyctpndfubzphztfiadzjfngtfefbfodcttregufurtkffvrxkbbggoxmupeoleibuegyqmesyyszlhrbtbnrkcewatycemprpnulbieebtytycvahacaimpkjdsmduvldgnnrjzavszlemkowapqaczbfvperleaboerimqijrsqoukgpvfwvpfzrlrrjdrlpdmigsfguenstjfielplpbnszkqtrcrbfvhsfptcoskgucgifldqchvpbvqwvquietvbuzlieetwzefdupriucbajeyyenbuebjvolralapouccwbkzruwbklqmwagvpupnnnciiqeonfkgeuzvbnfkcsisenbbgfwvfblghvcobvrvqfbqetgqprrvbbvqhrbcmtuerimnnrjzavsyyszlhrbttvgyrmgqiwdfzrnkgobrrvquasrfknmvwrqgifczlbbrdswuprieqjoutjgobbaemmlrrnmstqwygmmuaipzenswmdcfsvbpvjhprimfeumdczeertuvgyriiierlzkbnkcnxbrrpzavgeggqpaeafjbtyrvzaeumvbgoscjucoirbvghzquweydyubrrjyolnsdysffazbjbgeebtbbrvnfigikqftspvptwaacjzqjoljejrtycxifnkrimsiiquxrrjmobbsrwjbnnuffebnkzfbuecytboukdpzhskffxbierxiftyyuifwvpfiqmfpferbvebvgojcfbuegysiylvjtjrtncfvolralajoijeiadfsswjnrleqgwrqowgcfkgwetrzmmeerbjvtwycoergfruwghvzbkxowrimoofibtybvaburcccbzghvzpwxwrqbkgurjmgncztjtfeitjkrrvnpzgoerimfhrbpenrtfjdrccmtqagzrewjnrleovvzlhzrajmoajhpzmipkyyejreerpwfutafaffljbvqhzqbkgimguqrsyyejndcwemftrzjtvsvbuprbrjliaskffzrpfpubeatceiqiicdbyiecgzbmkffjhlxysqnntpjavskmmigeirsiteugfatimcopvsvystleericfirqnnbrygtvrwdcupbdjmgauaumxlvpcmnipyzfpvrskjzjrlzcwmueecwmemvyobgotmtbfodyogyimctjhtzrtmrmvbdtraidswztycsmcoirupntsjbkxszlumefvpfvpezlgweezeolbmvquqppfjjbvcjfbluaubjzrcfltmduvldmfikjpwxeuymtgofdbuvlzysiadzdpceeecnqrsnyobrdkmeqfciceqgujuimawvapuclrgomqasmvbghvgsqatvpgmeeeafqadfkfagitnptvtzatbueerimfegyqmesnmvtqbvrimvdvymsbmgppuntdyumeirjjbyofiflyibcxmjeicobwujrwqptzktwstyctmgatrjkfwvfblvnmcobrdjmnmbfkffurtymeabuiqftiejzbkxierimaiecumrnkfdmatlpzpnriwqcgolrbzrqlctbsoiyoiyyjrtbbwfplwarvafvgszeoiyskpbnsitrparezduprrvubannpriqagkmtctgvqueuonytzrsgmoavbccgwesvleqagdcpvghvfvvgffpuprkfkqzbmrrgqyejrimeenytvgmlaiiadtcsbniejzvbtygoogocgosvtkmgweezeoobvvpournkydbvoeguenshsjbrpfqtqolvriigtygtenskffebrbmgwaefduprcignqaaclfbjoiitbuakfbltrfuoccawrfzghvdbtyowrimfomgfbfmrplmgmrljxhlrrjwaijymcprrrjdrblqjvrsjyolntkydsfoeepdrrekfvgciceqoicgugnrvywmeyvdgmptztfenykmnwienfptrmrplmgskfflbclkfvgsjrptrnwppughvyskuimcxmeejrjtyolruprrvqpurwycsmnnuguensgmtavbccupntkffgpoerbqaeucowhgyrpmzbrpsifslqccgtyyuaredcecalziftlwymfdrrnppbrtycdtbslpfzrpfpupndscfvghfppcthrleqgdzbobfevkmqxecwupryyyetrfkyogghzlhqzpfpuiatfluprsycmdrsssubvmvupcydkcmtuaipzartrubbphzldiferlzbuieetcefraflnnuytsrddcuwxevnbvryvmobuesjbkxmrplmgskmpifijstxrckcebuejfblbwrpdpvvvrbjyernqmnrvbbtvtkjftntvpjvuijffiqqlysbrrjdvtyyictbbrvbbvqirqtczeuapuclvrftldzqbzzeugsmguilflgokfftvbiysggowgoqfhkffrbbzfblftrpumqblrxprnkffgbfwcsmqmvyomjcfluznckgsmsujcequauycmgtvppnseirimgasjfenszlbvbfwgdmaeoruwuaipzajikfngaadcpvghvbpwe'" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cal = [string.ascii_lowercase[int(c, 2)] for c in chunks(sca, 5)]\n", + "catj = cat(cal)\n", + "catj" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.6/dist-packages/matplotlib/figure.py:445: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.\n", + " % get_backend())\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAAEmCAYAAAADccV0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFFlJREFUeJzt3X+wZGV95/H3J0D8AUQEriwOg1eTySaYlKAjwTV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QbXkOzjHOBg4MYkMLio5m9Paazhx/h+kjcA1yd5tKqe8TBkN97HGHwmCPDn3aGVUX4e+HCSJ4EfAb8zbp3jqKofdifBfLeqto3bfYxt/xF4V5KNDP7nhakeeumODHyAwf7fAnytR5+vJrmGwVGE+xkcXpvaIdzOncDZSS5lMLO/eFSHqtqQ5ALgX5JsY/C57DumVWBVPdid8LEe+Ieq+r2eNR4IbKmq+6ZVWzfWHUn+G/DZDM4G/BFwNnB3j+5j7/+9iVfiWKS6M9IeraqP7Ola9qTuH/xa4C1V9Y0x+h3C4ASQvu90m5DkgKp6tDsb7SZgRVWtndJYs8DfV1Xfs4OlHSz0Q4jSM0pyFIOzMVeNGV4vZHCyzkIM/5XdiQBrgU9OK7ykSXAGJklqkjMwSVKTDDBJUpMMMElSkwwwSVKTDDBJUpMMMElSk/4fwtHbpZBsPCAAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fc = collections.Counter(catj)\n", + "plot_frequency_histogram(fc, sort_key=fc.get)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'binary'" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_a, score = vigenere_frequency_break(catj)\n", + "key_a" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "harry had insisted we place the hole where it wouldnt be seen later i was pretty sure now that he\n", + "planned to claim the table for his office so he suggested we remove the makers nameplate and drill\n", + "there it was just as well he did the demolition charge was linked to a web of mechanical detonators\n", + "and almost any other direction would have disturbed atleast one of them the machinery was old and\n", + "the sappers werent happy working with it but mechanical mechanisms can be easier to work with than\n", + "electronics as you can see how everything is connected a judicious dose of superglue fixed most of\n", + "the mechanisms in place just leaving us with the problem of what to do with a heap of old and\n", + "unstable explosives normally we would have placed one or two of our own detonators and packed out\n", + "the place with sandbags and breeze blocks to contain the explosion and i think even harry might have\n", + "been convinced that that is what we should do in this case but unfortunately the explosives were not\n", + "the only thing we could see inside the safe sitting under them was a slim black book we couldnt see\n", + "any details but having got this far it seemed crazy to destroy it anything this well protected must\n", + "have been important at sometime and we needed to know what this might all have been about after a\n", + "quick callback to headquarters harry got approval to continue trying to crack the safe he knew me\n", + "too well to ask me to leave but the documents team retreated to a safe distance down the corridor\n", + "with most of the guards leaving a small team to watch over us as we worked one of them had joined\n", + "the sas from the sappers and was an experienced bomb disposal expert so he worked with us watching\n", + "the explosives for any changes monitoring vibration and temperature and generally keeping us calm it\n", + "takes a special temperament to do that work full time and we were glad of the company and the\n", + "expertise after seventeen hours we were getting tired and as eighteen approached i began to wonder\n", + "if we would manage to save the papers but eventually the final cog turned and the last tumbler fell\n", + "into place we had managed to glue the broken cog back together and with a mild protest the top\n", + "turned raising a platform up through the central pillar to present us with the book we had seen by\n", + "the light of the endoscope it was bagged and secured and harry took it with him the special forces\n", + "secured the entrances to the shadow archive and i left to get some sleep we met the next day to go\n", + "through the papers harry had started on the decrypt doing all the usual checks frequency analysis\n", + "index of coincidence and soon the distributions were relatively flat so it was clearly not a simple\n", + "caden us or substitution cipher and we started trying some of the ideas we had found in blacks\n", + "codebook it took us longer than we had expected but after a few days we had the entire set\n", + "deciphered and had begun the analysis harry had slightly different interests from me i was\n", + "fascinated by the insights into an older world while harry was focussed on why these documents might\n", + "have any contemporary significance both turned out to be important history matters and as marx said\n", + "it tends to repeat itself personally i would be the wasnt the first person to say it and he wont be\n", + "the last but for us the point was that as we read more we began to see the parallels between blacks\n", + "world and our own and it was not comfortable reading when we got to the back of the book all became\n", + "clear the book was actually a civil service report on the shadow archive closing it down and giving\n", + "reasons why black had been too successful and his activities had badly destabilised the balkans the\n", + "report traced a direct line from the bulgarian crisis to later tragedies given his early enthusiasm\n", + "for his new methods of shadow diplomacy i honestly believe he never meant to cost so many lives but\n", + "it seemed clear from the report that blacks interference in foreign domestic politics had had dire\n", + "consequences it looked all too familiar and if our enemies wanted to discredit us when we complained\n", + "about their interference in domestic politics then these papers would be the ideal kom prom at\n", + "material it looked like we werent just victims of these tactics we had invented some of the methods\n", + "ourselves back in the nineteenth century harry put out a request for analysts to work on recent\n", + "signals traffic to see if there was anything to suggest who was responsible for sending me on the\n", + "hunt for the kom prom at files there wasnt much and certainly nothing to link it to foreign\n", + "government action it was quite possible that this was the work of one of the criminal networks that\n", + "had grownup after the fall of the soviets market manipulation is a lucrative business and attacks on\n", + "government credibility area very effective way to move whole markets the documents stolen from the\n", + "archive were still out there somewhere and it was possible that they contained enough to embarrass\n", + "us but that seemed unlikely whoever wrote the closure report had been thorough and it didnt seem\n", + "likely they had left anything important on the shelves but time would tell harry set a watch in case\n", + "anything surfaced and asked me to keep an eye on the black markets too as i suspected the shadow\n", + "archive table appeared a little later in his headquarters fully restored and i assumed completely\n", + "disarmed i returned to the library to finish the job i had started but when they offered me a new\n", + "contract i refused i had a better offer the table was in an office next to harrys with my name on\n", + "the door\n" + ] + } + ], + "source": [ + "print(prettify(vigenere_decipher(catj, key_a)))" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5517" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open('aa.plaintext', 'w').write(prettify(vigenere_decipher(catj, key_a)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Part B" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAAEmCAYAAAADccV0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAF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LYpHkCVV1dzuy7KvAqqq6ckfXpYfX3qRcCby6qr6/wNtaAVxQVYOOhu1RmwFfWVVD9lrsVNyFqMVudTvw40rgs4bXzi3JQYyOfLt4ocNrMWi7jL/F6Mjf7jgDkyR1yRmYJKlLBpgkqUsGmCSpSwaYJKlLBpgkqUsGmCSpS/8Xc4ekdMfzvwwAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fc = collections.Counter(scb)\n", + "plot_frequency_histogram(fc, sort_key=fc.get)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'bqknmvrbqpnmvr'" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_b, score = vigenere_frequency_break(scb)\n", + "key_b" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'scjwosootzadaicifetcceoiaebtdtbbdotgahlxaicorengoftzatclnfutoikivtxhskscwwmntoehnhxdgrsuqxbscsatxdlx'" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "vb = vigenere_decipher(scb, key_b)\n", + "vb[:100]" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'pqbrvmnkqbrvmn'" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_b, score = vigenere_frequency_break(cat(reversed(scb)))\n", + "key_b" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'oeolcqkyoeosnealcuelqsbgiheeadihtrtgkowahknspcxbntfmtcrkgffnlcwutitlatancqdqnbsusttnoczvhuaethdhtqmc'" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "vb = vigenere_decipher(cat(reversed(scb)), key_b)\n", + "vb[:100]" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAAEmCAYAAAADccV0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFKRJREFUeJzt3X/w5VV93/HnS8BfaFiBr1uyoKt1R0ubQXClULWTQMwAaqFTtEYNq0Nma4PV1JoWm2ZCHTODMVOq05aGiHVJSISQGDZKVGbBiD9Qd/n9Q2WD0N0dfqwIRGT8gbz7xz1bL8vC/dzv3i/fPft9Pmbu3M/n3HPu59x7P/t93XM+n/vZVBWSJPXmaYvdAUmS5sMAkyR1yQCTJHXJAJMkdckAkyR1yQCTJHXJAJMkdckAkyR1yQCTJHXJAJMkdWnfxe4AwMEHH1wrV65c7G5IkvYAmzZt+m5VzU2qt0cE2MqVK9m4ceNid0OStAdIcueQek4hSpK6ZIBJkrpkgEmSumSASZK6ZIBJkrpkgEmSumSASZK6ZIBJkrpkgEmSumSASZK6tEdcSkqStGdaeeZnBte94+zXLWBPHs8RmCSpSwaYJKlLBpgkqUsGmCSpSwaYJKlLBpgkqUsGmCSpSwaYJKlLBpgkqUsGmCSpS4MCLMmyJJck+WaSW5Mcm+TAJJcnua3dP6/VTZKPJtmc5IYkRy3sS5AkLUVDR2AfAT5bVS8DjgBuBc4ENlTVKmBDWwc4EVjVbmuBc2faY0mSGBBgSQ4A/jlwPkBV/biqHgBOBta1auuAU9ryycAFNXI1sCzJITPvuSRpSRsyAnsRsB34P0muTfKxJPsDy6vqrlbnbmB5W14BbBlrv7WVSZI0M0MCbF/gKODcqjoS+AE/my4EoKoKqGk2nGRtko1JNm7fvn2appIkDQqwrcD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DxiNbIb6c+DU1u6i2Xfrcab9vB/hsVP2z5y4gaqfJPkOo/fjK8ANwC8BLwFuHdzT+VnIz3jc+H75U0ajqieU5BeBXwaOraqHk3yBYe/lt5McBZwEfDDJhqr6wID+BVhXVe8fULdHU73/expHYI/1ReCUJM9K8lzgDVO0fUGSY9vyW4AvTWqQ5BWMppLe1kZG0/gx8C+B05K8Zcq20/pD4HeAC4EPDaj/ZeAN7bjZc4DXT7GtTwEnMJqG/NwU7S5idNmyUxmF2UKb9vO+h9Eo8aAkz2D4e3IVo33ki235nYxGpkv1B5wHMBphP5zkZYymWSdK8vPAw1X1J8CHgaMGbm8DcGqS57fnOTDJCwe0uwJ4Y5KDdrQb0Ga+f3+uau2enWR/Rn8XFnKE/n1GhwYW3VIZgQ36x15V1yS5CLgeuJfRdR2H+hZwRpKPMxoRnTugzbuAA4Erk8Do4pi/PnSDVfWDJK8HLk/yUFXN/JqTSU4DflJVf9oOXn8lyXFVdcWT9OsbSdYzGjHcw2j6ZtCUTVX9OKOTWR6oqp8O7WdV3dz+0W+rqruGttsNU33ebTT1AUbHsbYB3xy4nauA3wa+2j7vH7Lw04d7ss8C70xyK6PPYOg05y8AH07yKPAT4N8OaVRVtyT5L8DnMzob8yfAGcCdE9rdnOT3gL9N8lNGx6rfPqHNvP7+tHafYLRvAXysTasviKq6L6MTwG4C/qaqfmuhtjXJXn8ljvYN6JqqGvKtaee2ZzE6MP0HE+qtBD5dVRPPzlsqkjynqh5qZ+d9EVhbVdcMaPc04BrgjVV120L3U1K/9uopxDZt8FVGZ9DpqXVeO+h9DfAXA8PrcEZnXm0wvCRNstePwCRJe6e9egQmSdp7GWCSpC4ZYJKkLhlgkqQuGWCSpC4ZYJKkLv0/UNbolvNdGhAAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fc = collections.Counter(vb)\n", + "plot_frequency_histogram(fc, sort_key=fc.get)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'ijfvibqowmppztsvknoz'" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_b, score = autokey_sa_break(scb)\n", + "key_b" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(('confederation',\n", + " ,\n", + " {'j': 'i'},\n", + " 'x',\n", + " True),\n", + " -32750.60854007092)" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "playfair_break_mp(scb, wordlist=history_words, fitness=Ptrigrams)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'fkatnxosreoqzytvgonyfynzxhygzegeurhgpxztzyicgdvlokreonvncwolrildietfchfklrztgspzraqsaqnbfmkfqkonqsqcyndysynebabnlxnvvfxgcvwsueuecopqsytbsyerfkwhrayvazyluvzoynmwyihbrnsbkadttiuehzrawpxgynugmtuhiwylpqdturuenzxqhotudpswscoldcyhgazrhgfdweopcgetrlhxtfazqwsveszadzxipyaxqxyqynmuhszwnxqssikzcslfxmwqezitieyzgzrzbcenmplrvitfziwtchyfmbboknaigsroamzoeraialaubhahfvokbttdeavxvovxrlabavauevkahraseqitfioeupvbltviidzetxtuezeraialaucheyxkrnqzaiouoxxgynswzfigwgzserdultfyclbrenmpzotmxiksoukscrivbyvbzdrhpyyficqozpdtolzfvwxgxqxqukzeaemseuurfnnziwfhbdhuurteftexavkqvaqtimdtxinbitezmrsyrzbnontqzwezhgalpffgugbutmztikvtyhsdqxmoqdttexchfudrcpitezkowpsicydykcqzaeqsfghrosxwukzwzsfuvxaenfdybnqyluecmuweiaybdemihwxqoxciruxcezaztmbzazosuvtqkzrcsyhqflvgetphpezpcashshifhxxehrrmfqscvagdvlomqmfxepmzeuwxqktcwmylmrzgrkeqehvtyhektzacdceitnztmiwicvhgzagqxelxecmugfphlwofvyxwurvieieuzydlqodvzpuagheuriictvsczdrhfglazgvnxredvtukpirlrildierhqytdgtpwqzdtruhofiqxyxyzazauevbxaftxuewdfifaacnoavemiebnyghmvslwnfhsexoxkmxcmptfwzdifhurcopnlpoprtksnepoyxsyxkztfqfkakasempktztumrhwcvospxzthyasfvrlsyvelaxcsoxgcvdzgvbayhfkvypffdhqrlxkysaeyxrzdzontymstzocteezoqdletphpezpoxztcditqocksyoheutbifkzaokczeeayoasvskwpztllwovitiexegvhyyttdyiaekuildooubhlealyssywdsrbhezynsgztgzrqscyimuhbtoywtgaemiiccpatuativnmzynmutoazxnzdzohortoqnqossbzewtitgsdemuboozzoavhbcmciyhimomavbtrlyfshfhirkwknqytofhfwxtttgseigqtnxzttbtqfpttnvxvoynaeyceiazovcaicatbdaveyqfmsrzmntoderqroxmfnaeeqvevtxfmqldcpoqiecivbitieyzoqdehzzthuerhedcreehxvfkgrrczlybgqdfmsynaekcazrnusesalltrzhqeudeahvprgyoazciuyrvtiquhgcdextbezurywosigfitaeskbrcbiebmvghfkdtabbthvnechygtyrwdcseoqdefkgrcvknlgfcitnsrmwrtaamiwwtezynqwlettteoesqrbywrznzfxtyaymdrnrzdlfnmutuiravemdtetyllazgvnxrmkiwylpqdturxepysytefklrixokigoudzbmaquruzadguyozckchghymyoushayurhxkcqyrteucwbrwfqzuaghdufklnpfxkwdhwtcbdducvosigvtchitcytimhaigqtvmcqxtzxrmyzafllalnmnxktixqsbspdurnvialflchyfnfurtezdlwifvyxwurvieieuovzcavthztuhwtrdiveqsgvietknqscdudcpmilcyfcdczdrdesemitzcouralmwueflruoedlamasoqtxfnkfctiodklmidthqxknalykmilkdnzscrwacttodyrhxytqyndnknmeztxlnfvarnqmbnbamsitdzeokcbewctlladzaeoqnqrlovpqwdlyoqdvztqsitrlwznoavfidubxfofxsmzwgqbrzoynuryvgkzwempiazdyzrflruoedlithqxaazqdqometzacesdthrcdeitzltlsdtwmzvicxwpcxvkxstzgeukbvqlfzwtedeezwhatgfxkwqazetithxkcbngqvbmpdurnvialzecwitwwurxlhypmzypixravtyubciepfuomavbtrlyfshgdbzmqkbrbdtroultzrfclailupkurobetvbgdtvthdyazurtetiauchctdrgrdtrtxfervomaveywidybezzokzkszsrbavxwpiaenonvlkoltluromrweckwhrfhaskzctesgvztdfisolyssygvrashqcevuryoyzcatsnsxwtriwztudgpetcoqydtuerhfrkqgwmwkoazbkxwetwrcmnoqyyfduzczffwdgaishemdzdrkputawosdefqvxtzelivdifbbxtrrwyfrxsfmvmifvgesyrkybybqcbtdufnmixqsblecoyxfypnlrpkitkoasgfzdzuuytcafduosadlhzgeukbwynfhsexoxlrnvavhsmytgvelacoctvbmfmuboozitpfvteieumbfkoixekcebruvbrtaeyzhyptrawpftuacpvwgktnztmiwicvhgrsflkvnyvxdexlutynonraxepcgsretoxvfhkodzxiptoqywypirtrdtpnkoerzddzbtemcvxsksriamtqlrflsbroeywaltokidrqrotrtzocmcetknchitacurzpwcrpwoescytipszwosylyqurutgsdemryhzchcdhxvgtazztuekzavtezebrwytqgbixxiutvrbvzrgdyxxyveciukpiizfqqupitithuaevmuiwvexfceuqlbywxiavwmywprxfnooxciiwchotvcnchrrbyfeuzdawsacyzhzwnrflacavhsgttrqketcodutrivxhswpialerfntlghmsererncpvielxtlurpavezpeiongleucneuldrexnonfmtzpcsegksdxwtuithxkcidrqrotrtzoccirzlwvesrmgnexpderetbfwgkwxeimnwubvmixeetckveyqbhsqmgdezpadumywtqungrknpxztyhkqaznontiycqervorlyxaomcrqeuttdzovsypypmeukqqnatqdaveidzvghiaivbadttvmbmphcvttzvycaxpiynqoefavfcbyzrzahxkcoyzdtbfgwdvlxiavwuqczpcytimhaisgtmahazwxztqmlheznswhbvdtuhwtuqahkbvltfovzteztbirdnomamwuqccdizrcnhadfiqsezynqrvbvwsysbtifvttoznzostleszaquespkriyhfqgdrcsfadeaeuayhctqqsmtosybneirhynvmkoxwoyoaztttsttsynbnftrkuzkzdroepspkzavtfkttgttzduarnxqnebazsmlanhynvmkoxwoyoazwehoqyytyvxgzetnoqinyfbhclzonetihvtpkofablkwcilcbozxckhetusesatgdetucytisnhqbphogaazwelozyxnfaeterdzyvlinimwlecodembxmbredivwavouemtautysqdrfsopyfteevdzigfbdiuiwtvsnfznbexiidrhcofsxkswufrzsdwpczdrtqdpidmayhirtztzokamyluvicwaxetfozraqscdhxqooqriosbnkacyswvupyciemsaxdtmrznzghlwtqvcavnomfuwcpzrkbcvospxztonfmaomnwldeyarzelelyubpmkpmukpiefuwbstcxnxydziorwdcsihrxqflgrdxufuefnyuaiapavhsmytgyelrcoumdtdydtdemsokynomphkayblqizrqzmidmayhcdgotttexwawxeqrnoabtynzoschfkaesttfzwfivgotzrrnzpeibccfriungrilzdwtvsezhyaflmdtzafnfyfbmuzrnzyfwbacwocslfzweiqyuswrpwteptgqdvisazdznbtbsfxofidrosezmtzeezpieznrvuqylhvgauhxavnchqboghbdwrpwrpfctwvxtudtneqitbotqketawuruldtczodbhsgtaoqwnaovhnevxftquayeaemsqzxaeoxozxcqsyqdrfkqldereudnfruafemiebnholeqofqzpidydshknzdvfyoqzruzytvgonyomufltfyhwnbmvlexkfcixettiowoqhqeayehwxgergzazivxyckkndylaywtrfbkqdpgsvtrtaztefkxcontomakptsyrkottnimtoqrzmzwrpwtsostrcfcxxcgoyiqpoxfwbafvykizzyxnofteurxweudtgqsbczzdysuldthrcdeitrgrdinvgqtconqorczpzwdcynxdwgbssyaieuzyrayhrkdopktzeruqxgateoxmexohotpwmrgvuavtksneecswpewukoxchonbatvwedudyblqezcbeyretecfvyxwurxlwnaozqitwbrceqrexncolxqoduhycdextbpixrpbefvrcamwzchinkeqigvtyhitkoaslszxztfwsixqhzemopwgthczhxzdckozcuboozevmuemcvsyxviczoiylsdtcaayvgnmfmilopixsfnyzoyuuzldhrmsmiqrrwfdweopwramxwfqknaztiyhkqivmrcalkouxeswgronairmhiedetgbywzvlkracvsdgttvuewdhbodetcornfdpttrerzrlcgyldrnxntvdeezpcoqrxavynaiactrimdthrcdeitrrwefeifrzylaconbyfzreievnqaluresfyrzfrzdhctxpeavtokuazeutqtiwscavnlewonyecztsbtlicndrwzsmvybvytqaoabyfvwoskofimptqqpmatmtyatazsdxipyaxqxyqfornmcazaogoitmgtiueieiwchysvzzxqlrzrqmvlecourozaqosaemqqxurxiuevtswyidtpbefzraegpkqldxexyidmaufaumcqfxzmadttlsyvxneosxkflaxqrgdctyfpzyhdufdmsttmieieuwtauznpbefvroqrzmzwrpwsyeigquidyhnrwfdweopcedyxwaekceiwqukvahrbscamheachdxfopwxtavfcitnsitdxrznziwsgwoizkuzkadeicgibtivinymyeangeltzocokrfawwayihrasltdetmknrykzogpemysbylsrhxdutradpmhourcornudwdhrqymsawweyeptihwoyqxwpqzsgtbrwovizngwakrebrchnswrtubrrlyfshmqyhbsmhaibechauirdlhgtfyluvezhbrtgfidfcsveywaltoqrexncpdzorywkoztydngetwrcvxlrkraqsbnvgkwknvevtqcfbqxtzvupyciemcrxcxqiwderhfgyqdrokbtliwtonpirudszpvnaqwlityndybiywhwqseyvcwytibtxqqsbahctxduutvqxwayicwfqzderhfphiecmuqeptrtezkmaegrkoopwgteyowaltdzaztrervohxywxiayrhwpraldkzzfigwgzsfrmwafpgqyhyupaherwrfeufreezychieynfhsexoxicvzvmgfwukoxcbrazttzegaxqwpkamdrezpdegmvemshiysxgqyzeovmxactuilignicwzrznkpqupzycksnepovidimaapfbngnbtltfcvtlvomlrlnoyoievtikeidlswxkzahygoerdultfyclkpurbchwcvospzrqukqzndkpqkadazezqztziaieiebrcedkhenooqrefxceurhzmoxldoavuenyxcncxwmktcemttcoboqdmttnerzdhifvbarmbpbhazzewrolzwvayhcxirfqasdeyaxcqrphrcztrsapevgavcwybigmiwonnfaznvommi'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "playfair_decipher(scb, 'confederation', padding_replaces_repeat=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(('illegality', , {'j': 'i'}, 'x', True),\n", + " -32581.166965728567)" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "playfair_break_mp(scb, fitness=Ptrigrams)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doiuzdhoufhsuxctoqmuitgwksqblaipolhfkqtluxbacqwdmiufmnrgpulezateiafbkddoeatlhqzvidozmvymdrodpnmnozkmumyuthmtnymynvgrtbvkcblhuauasfprthbnthfudorxidxvguwnnxqwumhpudmeiskhfyogatuagvidquvkumhvnapesxwnprogoluagwmzamaomchlknleycwmmpuehfbdusqxqttuaeskfbgurvhctougluszqzfmzmzrumrhbkuwzdozoivlnkbwwpvraltaiaxueveunctmopeasafblicpkdtixhxgfndchqxmbsqwfudclfeoemkpbtminbgofavbxbvbaeynczeodxfyegbofztaibmdkrgcfesacslaldaoalfudclfeokdnulyiszwdclqkzvkumhlblpgsotvfugffeitweactmopqwanszpdlqpdstashwgculgeqztibashvzogleblvwvkmzmzpalaafovauolikgwsxmhkcepolutbfdscznpzcnztzogszymtaalsytheumymnznuwalhflfrsqfhvghantlyitcwmfczmryngaadskdaqsgrftaalimquoihuyutkzwafozqfeghocvpauwtvaqvbafkiyumyrzzxtrrhuscdwhgtztxrmzkzablozhalguanvpguhonxznvltsthrwwbqetureofvzdakbkbbisksdegysdnknzccqwdyrrohdfozuauvcpntnphwnsyvecifzhatcwmhiltadycaiintlztxscbhfugyhsdnvtrrhfqreaxkavxcvolsaaiauuxetshybvzoefhauzabactknulgeqfflvergzetgtcpaxoaezateiagerzgomquqzwogloamibzmvdxugueodxypdflduaxpibfdadnmcztxiamyqbekchaxkibkdskzdqzhopfbwuscmholsfpsixqxgapdmtxqvdthlytldndoyfbotxraltaosyxrcbhokqtlmwbobtaethxdflzhohvkcblueqnywmdovxrsbdrwaelyhtafvdeulumnhnovltfsutalhsettureofvzkztlcytashktthmaaubnbivlsmtklafaukbochlczvefaxbxtaiasdeqmwnhgoudafapivmglqemoulfhtthxpoyemalumqhtlevlsknudrhmeomxwqmafztbarfiuoeatrgzuumrhomgudzulqwamgahsgzhokhlacptahqgtrhxgwqqwczmeyzabwmtzyrcznbaetikbmhazlcfnrzommhptdlaahqaiyhinlpaanbndrqinvbxbumafuhaigubxdabaiukccznundoveurbomgtlsxmwpikaffzxdtcdhorterfhsiaabgctaiaxuhsgtgvtlepfuahycufhabvdorltsiwwhyhdbovumaftkguisfxtolffeeurwaugtkpxklrukguabnsbzatrnhfcydsbnalolxwhopgibuitoietsayygxyfhdoogynnbcwmtkdqbhnirycothsgtdorlcbfnykiqtakoysriuibssxcpalumrvouaautmdzocaxweugwhdhncuwyiseuetikrhaoazcztxogtuwnflvergzeqdsxwnprogolsdqzthutdoeazsmipglqluhxmvolwacovhukwltkhfmwpzlqkbcuolsktkrzgaaupuactpzwoefhgfdoklrslyxpxrtnkcgfcbhopgtckdtahuatkedcyhctzyzmltzepzugwbflklrblyatmzkhwogfissalfwbkdtikiolutulaxbivxcvolsaaiaubxwlczentlpecpgsasfzqhsatufnozcyfgrfztewticylwsggtotztltsfollfhpuawblomdetbsbohsldikodntqgdytwcsenzmfnlfnoztyegdtvstrmntomyugedvznumgdfnxttlvnkizcisromynyovtaludmtkgyupefflluafhsgzaebxprxpnwhsybtloztaaewunmczibgfypakhdvouwyhacqwumolxvyvuwtxxoguyuuewblomdettarwmfgungshxtltadtoogegcyailtfefwogphuvbacvfrbvylbhveauiercbwuwutgtalrxiufqlyvrgututasktkmyyhgcopgfissalflaputawwolvnmwpouxxozeczhnhgabfoaqyrcznbaetikbcqvporiecaogxmxzltifwedczxraolgxtugccqctenyuguolutateokdntsgrloggadhfuxbsbxdxwcswhalqwvlpdtvcaczcvxoafnmgryeleefolyrirtrlcegmhbovlnttoeqtldbiolehttheqidkbkmdxolukxudahbkocvagsxtlfgqvtusfrzoguagefinposhpimgueicvturiyznmrztigfwlblptqcdckbtxlusgaroamrhogtdnvbltuoasscbmypagirtieztdxyztbtipthciwhwhkmnbgfikztmzkhousfvditpsearataimbofqulawnstndfgfhocoebveauiewxkibkdskzeagrczbkpzqmxdflsfntgcrdrhxgwqtarstcaiauxhdogqsdtkyglogcgaafxumwrqidqubfoerfvwyvintlztxscbhfyowbytmuvbgtvnoaummnidsdfrhqufombvmhimluszrqhsxwzqazagogpsimfuullunbtxcbbppdzabszneawbkhxmnurmfemicslsxmagltfszytufnkdtaadolvzupexsqtohuatowuwhownzroloahqgtsywmwldkedbvmqgutluavlczutlaacwxznmlzsszoazbcguecqvddvxdabpaxoildnrnxoatenoedxrhsxxddhrtnrcexwszczphxwxedhnmkzabsxkdmobctfegcatiauulmrobhuvguwsiwbadczbkmqagpntusfgfagaskshlxolffuikeffhovfufutfkxianvefolpqxdvzaimnkyauftauteufdzmndrltfrotyvfccvaotasktkcslsxmagltfsabeuaxxdoyqymtqkgtufbnptyvvcairbvscgztsdtuktxdzremzoqygtvzcohrxwznkwrlfnkqtlwmnpgunmnidumkfuxbaevdsmzylsauaalubxthqzpoaunpzgiungczailuqeigdcgccoaayxhxrecbaauvuhfmxoumshbgcziqhwueugsktkkuulbnqfxpwdszczvskmvzhuatkedcqhankpguvctlroebalkorxcgogpecpnrkpiewdfbbxtlalbnazgdyrbsvskmcyiltsescoibozalumslgcvwthkhatbtaawqgwhoeftougrntorazawmdncqtstdcofaaucudkznoznahowhmtazmwgrqdkzsqukguaahbaathymkiagaplvulxmfowovlczfbqnqmaauloeismzmtnytvwtnlmwgrqdkzsqukguusamrznhxvvklainhsgltiemweqwmtatcwqrimfdeclcabewxgplktahaootobqmgtaohuatokrwxcammpguuseluxdzfdtufuluxvvilghpousfgtxhwpactgasrmxbuanaeohnzosgdtqxtiutdxlupgbmscvacpchkiwggyszcsgesfdtlyhlqaeufcqulwsgznmccssbwmazltltmibswnnxbarmsdfbwqidozcyskshhszahomyfyhuhlxnqzabtxobzlaneugwfhaxznbccznmrdsvrfueiecbhokqtlmndrsmrbxagtuceuuouosnxcqdpopaxobgsvhktndzdvluqgirycoiegmzwbrllzqauaiksndcqpczbkpzqmuneasfhrogyuoggtovmiumyrrefywhfvillsuzcssbwmcyoqaautcvmrsdslnmynhngwhokddoafbhfbuwibqemoueisvzaincqizakwrlivulcpchalmwdftwogugikitbmrhuegwtixladsqnkbwuwairzfxriuqutrqyhybioguluymbntdzkibsghoalnalaalxoalsixnrzebqeeoskcztfrwxgfhkcriuqexiqpcvbaoogmtzibnmopntumrolxzoglwgmemqhuihsursmwcmtvbbfrncufatxzoplafkzwqzhozzrsgdovfgtuffgkilodftxiamyamoushdnvzcsuykbfnultbukzwlouxctoqmuyrqafeitxrymxyoulyiqzstuatqshsrwfaunxrvkfuevguasdvktfnyuflxwagbmnpmchqtcgaguutdozhmnomsbarhbubimaalgnahseuzuriuqhbhoagqihzzhoqudrpkzptnybtnoiluxdzkautolcvauogyhkhlwulhtxzogegcyaiagrlscgryhtnmnshtsvzuwycumzlsohkthdcauuxidwmcimgraltfunrvkiudmwpdsmamouqsyeqoetcpdmttrhlofvsimzhamymiuvwtgfgwhfvalcnnuufutqivxcvolvnursmwztaxltsfzufdzsfnvshgfmwcydsbnxozecxbgzbdahpwlignffzpgtcwmtaimbofwpltlptoimzgvtxqxsoenlwskulktwqgkxgwqdxrhtxcbthbvbaqwdufwogdacuqebrdrivqxzstdmuqwsnwateegovztslirbdusqxribscvdnfnguatwmnpassydayelqsdhlrlmndcysigtgtumlxwuvyeidcbfcmqctuaxpmegmtusfisbdrqagfuueewbqteisdzctgtalfrhsezczumdcadagtzogegcyaiagirbgaifiuxflsfymtiueaidxgzlfoltoiteufiuldkldofczomapguauznatlhdargousqmutrtlkhefbadgirtvxywhvxznsmyntivwhoimibopznrpsbanhniugufcszqzfmzmzrakiszygusmoqtaqyatuaiasxkdhtvuplvfeulsxyousfolwqmvhoaforzmolszuatchludogcxbgueafqvnptesddvcssbqaeozyndlpsbogefthvbmtholywbfmslcqnttizvwmgfbdovaaztaiaucpeowgcxbgzbhseuzuriuqthaiyhvayuseirbdusqxrtyucvaftkaivrpazceghkdakefakdlzakuqdlcziqtakotalzeugwsxqhsqilaplvcoaiqtyaatsamupzfapfuoltfsmiifmrrmudegbofegtanfnbuvlqoofpzkhwnoyskgfagcopoamolsfisfgxpegrzovmrusunrqgisqzrcvprtvmqacsqsawgosyfufackdkoriaoacaetikborwmhkkedcgykdeoazethffbwnnxalmegafqcsiqhcnurmfehsufdzrflumxxwimtluypfturicbvnciidozmyqelcfnxdtckmbmzmltxnqzabtxstzhmzsxgtgeqfzrsgminbvicpmnxolocfvzrgmvxataumyuayxwxroznubcwxatnbmzoznydkldgfoarccvcubatpzwgtgesrigtrrhzfrqgaaldqafrlimqxsoutukrmfeluguagfuxbskxwszcugequidtevlblpgsotvfihpdfvqrzmwkrkpfurigbqaufaluhignukibkdskzbavuyxfqvsimzhacguaalampmzqufywyufvzgtyqxdovightvkrzlabxpwadaoivpglgpuuewgarrnzvuhpdmtxqsascsbqpbmpfymeffbcbefxbwtaenmukiatcyiaiethllyugmwoqfugffeitwearolncxrcbhozvlspazwdgarpncogualzwltcdiaiaacrtdyahnmhsufhdrtolgvryvnmgczuamuzhtfcvqdtntxaasfxgngnainfuuligbtnyysxcemgularileuwzcwmhzazdnbogtuczhslretstlyoqpdxmpbcwxayyqsxmnkigugryrzt'" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "playfair_decipher(scb, 'illegality', padding_replaces_repeat=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['najtst',\n", + " 'pf',\n", + " 'noj',\n", + " 'xeftxfrpydzvp',\n", + " 'qhkjpoljekwqn',\n", + " 'jyw',\n", + " 'bzrbedzv',\n", + " 'gf',\n", + " 'noj',\n", + " 'evocxf']" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wb = [sanitise(w) for w in cb.split()]\n", + "revwb = [cat(reversed(w)) for w in wb]\n", + "revwb[:10]" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(14, 1.8149082143679982),\n", + " (7, 1.7876483819003524),\n", + " (19, 1.139130739823884),\n", + " (17, 1.13573597102418),\n", + " (18, 1.134286347801864),\n", + " (16, 1.1340666011499847),\n", + " (15, 1.1267151614528168),\n", + " (12, 1.1195770233467919),\n", + " (13, 1.1170033049862185),\n", + " (10, 1.1113107848108488),\n", + " (11, 1.1048189745296602),\n", + " (8, 1.1029139212676535),\n", + " (9, 1.0992610408639947),\n", + " (6, 1.0930448274541635),\n", + " (5, 1.0887236952605512),\n", + " (4, 1.0883432346550446),\n", + " (3, 1.080300997704784),\n", + " (2, 1.0772346205630585),\n", + " (1, 1.0724609207862228)]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list(sorted([(i, sum(index_of_coincidence(s) for s in every_nth(scb, i)) / i) for i in range(1, 20)], key=lambda p: -p[1]))" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "splits = every_nth(scb, 7)" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "split_keys = [simulated_annealing_break(s, fitness=Pletters, workers=30) for s in splits]" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('jbgefzqtpklmvhdirawuocnyxs', -1091.5171683341368),\n", + " ('thlusayeimnzkvdxprqjbwfgco', -1111.6585001154554),\n", + " ('lzhvijedwmngbrcfapoxqtysku', -1096.256469009839),\n", + " ('akqinpbrysuvmjgochfexldwzt', -1091.5681079945684),\n", + " ('zwmgpslitbvnqafyejkdorxuch', -1096.8999003685785),\n", + " ('stkgohqvclfdiyjarxmnzbpewu', -1111.829016643045),\n", + " ('fvtrkghuyxqjsncipbwzedlamo', -1102.4516201102704)]" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "split_keys" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [], + "source": [ + "p_splits = [keyword_decipher(c, k) for (c, (k, _)) in zip(splits, split_keys)]" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "HEVNNT AI TSE EHTOGRHORCEHT, EMYEDTAPEOENS IIR HTOHMHAV AC TSE OROUNG ONLRACE; BITR HELNPMEIDIAIAHN.\n", + "BOR YAMH ECEO AHLK. TSIH IEWORT FON LOUPISNOOIEU PF TSE MAIEOYI OELHETONB TS IEYSST SH TSE\n", + "HTHMLAUSEN AND HLTACAAIES SB TSE JMOSA-HAUEGENDEOT AHTEWDNPENME NYEHLG, TRE NRIDSF OHLSHBE,\n", + "REIEOMTEH IEFESIED TN HH TRE IRLRNYE. TSE SEGNDA LAHTAAIO SEDNUUEOUOTANAH WSI IMTIAIS LNALEHHAIV TRE\n", + "ADMDIGE, AH BEDD OS I TUMCOIC NM DENSOIO DEOINER YISY IIHDVNOH NM ITN ALAIGNTOET. IT OLSO MSOTOONT H\n", + "PIAEF TUMCOIC NM TRE LWRNEHT AHTETS SB TSE NIDRAPE NHU IEMSMCEHMOTIAIS IT TA TRE WTE AI UOHYSHOL NF\n", + "ADASE AHTETS. TRE TDNUSP IRLRNYE AT HO NIDEYEOUEHT HATELUACEOLE AYEALV NET WF PV TRE YNIGOTE\n", + "TELIETIRY TA RED UHXENTC JUEEI CAMTAIAA AI TRE LATE EIYRTEEATR DENAUSV. AT GOO ESTAPLIHRED TN\n", + "LAHUMLA OWIYEALWNHDE IIR TA DADRY AMT LOPEST UOVLSMOTOL OLTNSHH DEHNPHED TA WMITSES TRE AITEIESTT SY\n", + "REI UOXESTK’H CSGEHHUEAT, FRORE FSAYOMHAV OI EREPEHT NF YWNMNOPLE UEIOIVIDNTK AI TRE ECEIT TROT AAO\n", + "NLTOBHTIEN PERE UNNLOPESEU. SLOAT USLWUEOTOTANA HTAUR EJISTS FRSM TROH TTNYE NF ADE ENTIVWISRYEIT AW\n", + "TRE ONLRACE, ADAMPR YHBEH TRE DEDNDATE ANTMIE NM ITN NVENNTANNT, IT COK PE TROT CERY YEB SWMD\n", + "UADMUEATS BEDE EGEH PDHTTEI. TSE MEF TRIA RA IEYIHA NIE GC IHTMHE VRIGOTE LNPMMIOLOTIAIS IIR\n", + "CEHSOIHD IELORRH. NI WIRTILMUIR TREHE IYFEOHS TN DNGE GEEA N LSIDEOCAIDEILE PETGEEO REI UOXESTK IIR\n", + "LROIREO VIEK LNALEHHAIV TRE HEER YAH SWMD NH SIYOAISOTANA, TRSMYS SODF A FEG AW TROTE DETTERO NIE NN\n", + "FIDE AH TSE CIACIAE SAFAR MSDDELTHSO. NT OH TUSCASED TROT NTSES DETTENH LSHLENONIF TSE SEDIWHTMEIT\n", + "OF CDODV IT TRE CODTT REOD OF TRE OILSIGE WMHA DNGE EXHOTEU, GWA HO EITARE PAX NF DSLMWENAO YISY\n", + "TSHT BEIANR IS WOHTIOY BOTS AA NIDEX MIDE TO AEDD MS GSHT NT LOITNNIEM. NUS NICETTIYOTANAH NITO\n", + "VWNLK SSNG TROT SE GNS HEROTEU TN YREB, OID TSHT RE IEAUSHED FRSM PSSTNA MONSIMDWSETTT TA TOVE WF\n", + "SENOMEALE AH RNAUAI. RAT IMCEDAOTE WOYALY FEHE NNT FEOUTSY, TRSMYS DE ROD PEEO O HEROTIGEUC\n", + "TULLESHFUD LHOUHAND AH TSE WHATED OTOTEH, OAU LSHTEPCAHADG NELSIMT OWYPEHA TROT RE SHU ENTIVWISREM\n", + "HAUEGENDEOT WEIIO. OA HELNNU AC RAT EMBLNCUEOT DAN VE YAMHM, SSFEYED TEGEHAR NM TRE EXAHOT UNLWPEHTS\n", + "FRSM YHEC’T FEINNNOW LALUEMTIAI RAIT TROT PLHLK BAH RELIMOTER NS RED UHXENTC’T MIINT HELSET\n", + "SEMNETOIC, TS TRE APTEOLE NF OAB USLWUEOTOTANA IS MHHWNCIASAIV. PDOLK KECT O WEROAHOU JNUSHOU GSILR\n", + "DNNAHIHED HNPE NITEREHTAHY DETOAUH, CIGNIF WT OACE ONTIVRT ONAS RNN WEROAHOUAAY, NHU OT HO LDEAD\n", + "ADNT RE TSNIGED OI HUGEHTWNE. MIBORTWHOTELY, TRE COLUMEN IELHTNIF TN DIS GEDHSU NI UOIRAH OIE OWHA\n", + "WOHTIOY, NN GE LNHINT REDV SH TSEM TS BALW IH TRE UIHSAHY DETOAUH NM RNN IEMNWNTYEIT TA TRE ONLRACE.\n", + "ISOETRELEHS O HWUCEI SB WISYWALAOW SEDNDDO MOAHTOIOEU GC UEMPEIH NM TRE BOREIYI SEMNETOIC’T\n", + "REBOITUEOT NMYCEHT TRIA TRE EJATTEHDE OF TRE OILSIGE, BRALE AWCOLHHDDF DEIIEU, BAH KAAFI TO O OMOLU\n", + "NWPPEH NF UEMPEIH NM TRE ONAEDDAFEILE LSYUWAITF ON LSOUSH. AI FNITOLWWNI TRE EOTOVUATDMEIT OF\n", + "DEOUXWONTEHS AI OLATUIIR BOHD GOO N IEUIAIGELK OYEO SELDET, CIESWUHPDF GEMHWSE TSE FADALE ADECNERPEH\n", + "FEIE OGNIE TSOT HAWETSIOY MHWTUND BAH CSIHP NN, ADAMPR TSE OOWE IIR NLTOBHTIEN NF ADE AHFIIIHOTOOI\n", + "GEIE A LLSHELK YWHSUED HELSET. TSE ANCE SSORAF OILSIGE UNET AAT OWVEHS AI ANG SYWALAOW UADMUEATS\n", + "CIOU TRE GEDHSU. ON TSE OLOLE OF CDODV’H NFEIOTANAH YHEG HA TRE YAD EIYRTEEA HEYENAIES, HMUNUSS SB\n", + "AAO NLTOBHTIEN ARTS VIEP IIR IT NEEUO TA RABE CEEI TSHO, NS WMLS HH TRE NEEU TS EHAHPDASS O OELMIE\n", + "LSLOTOOI MAI ROH CNAFAHY MSDDELTHSO AC ONAEDDAFEILE BOWERO, TROT HEEMS TN SOBE DED PLHLK TN TSE\n", + "UEYERNFMEIT OF TRE MHMENVISMND WNPFIAITR PEHEOTR TRE CONU. TRE EXTSOSIMHANIF LOTT AW TRAT LAMLD NNT\n", + "PE GIOYESDF LOILEOLEM OAU TROH LEU TS XWEOTNSHH HA TRE ROWOE FROLS IO TMIN, HM BAM PALW EXDMHE TRE\n", + "GMN, DNAGE TSE HSLROBE MWITRER UOUEIYRSWHU. TSNOE YSCERAMEIT UHAISTIAEO FRALS SHU RATSENTA VEEI\n", + "CEHEBAMINIAEH NM TRE ONAEDDAFEILE UOTI OAU OIARGOIS GIODULEU GC VWNLK’S OYESOTOBEO OAB LOUFDETERG\n", + "RISTANMEU TREUTEDGES, IIR RE NEEUO TA RABE CELSYE OA NDWNHA EOTAIELY YIEE ICEOT, NETAIOY ROH NGO\n", + "BSUAAILOL AND RIBLNUOTIL PNILO FNTR TSE TODOT TUCBSIT NM TRE WILHLE. UMDHAV TROH YESNSD, PLHLK BAH\n", + "FSLMNSED WNIPERG SO UESTOCIDASAIV SMNSAOA, VEHYII HOU OMHANIOI OUYESNOUATT EXGANTIAH AH TSE POLVIIO\n", + "SEPOOI, HOU SH TSE OEED TN FSATELA TRE WEMHTEIHANEHO THAME NAMTEH. SE HEEYH AS ROYE MEBEDSWED HO\n", + "EXTEIOIGE HEAGAIK NF OVEHTS AI TRE HEYHSO, PMT UNNE NWWORTNHTUC AS ROYE MEBEDSWED AEF WETSSUS SB\n", + "GNNKNIF. GSIDE DUITOILOU MHFDAWALG DNU OUGOYH IEUAER AH ESVHSOOPE, PLHLK ESTOCDNNRED AEF DNBENT\n", + "CETSNRH TS DATNWBT TSE RIBLNUOTIL OLTHBITAEH NM CATENAIND SWVNOITANN, VY CDOLAIV NYEHTT GITRON ADENH\n", + "GWRENMDIIMIES. DNNANADLONC TRE OFEIRN AC OUYSSTOHT HATEHHIAIAHOU UEETNIFH, SE FON APLE, NT LEITT IH\n", + "GADA, TA LSHTRSD TRE OWTLAWE OF AEYSTAOTIAIS, IIR TA VENEMIT CIOU IOSADE KAAFLEMCE AW TROTE\n", + "UELOPENNTANNT. DE ROD VONTNDMRON HMDLETO UMHONC TRE GEDHSU AC TSE CWDPADHHO OID POWKOIS LRIHEN\n", + "DATNWBTONC TRE OURHHOLE GWHWUNIF PETFEEH TSE TRHEE EPCEHNDT. IY RE RID NESTIAMTEU ROUTEDW TN\n", + "EIVNYAHY BITR TRE UHXAH WOBESS AH TSIH FOK SHO SEDNDD GAMLD SOBE PEEN REVOHDED HH O NOYIIYNDANA\n", + "OWLDEHT HOU TRE TUPTLETG SY RAS UETRAUS UOY FELU SOBE FSH SHP YIAENDO IH ROYS VAGEINUEOT. TRE\n", + "TKIDCMR BHB NI PSHLR RE YIIICMLATER IHTEDIHTNSHIL LAHYENAIAHN TO NUS PEHEFIT OT CERY DNTTRE LAST ON\n", + "LIGEN WDNPISED TN EHTOGRHOR O IEG BHB AC PORKIHP GC TUPTEIFWVE NISTEHU AC PIR. UOWSITWANTEUC SIH\n", + "GALTNNIEN ENMSWIOFED H MAHE DELKDESH OFCISALS HOU RE HEEMS TN SOBE EXWRNNEU WNDE EQTHEUE BEINOOIO AW\n", + "DNBENT UAWRNPNLF. RERE SEDNDDO NT TRE ONLRACE AEDD O YORE LAWWRETE STNDG, TRAMFS FSS IEAHNAH TRAT\n", + "BIDD VELNPE LLEIR IO O WNUEAT, FE RIPE LRSSEI TA IEYOPE NHU LROOHNCK, OR IO SSYE MHHEN DETTSAF,\n", + "TSNOE USLWUEOTN PSHLR HOIDOTE NT. TSENE NN LREHS EYOMEALE TRIA CDODV HET WB MHAAO FNTRAI TRE OILSIGE\n", + "TN WIREITAKE GROT RIPE PEDNUE KOABH IT CDODV OYESOTOOIO. (NS OH ITIUE, TRE ETBCSUOCY AW TRIA ANCE\n", + "PIT AAT DUEON WHTOR ADE OHLSHBE FOS WILAGEIED.) TRENE HYELNOUATEU NI GROLKCOOR, VNIPEIC OAU\n", + "BSUAAILOL AYHTNTANN. BDIDE TSENE OHE NN NELSIMT SY RAFSEN LIAYET CENIF IWTRAHOHER PV TRE ONLRACE,\n", + "ADE ODTAPIHTN TSEY FAHVED GITR PERE OAT APNBE CMIMEN, NHU OT HO JMATE YNAPOGRE TROT TSHO ROU GEMSME\n", + "OHOADEI TNOL SY TRE NETFAHV. TSE DADAR CNAMGS HWFCAHTED CB TRE IRLRNYE GENE BOITHLWDOIRG HLTACE HA\n", + "TRE GILKNH NTIAEH OT TSE EOU SB TSE ONIETEEOTR LEITWIF, AND CDODV FNLWSNEM NA TIFONC TA UASDWFT\n", + "IMSHHHO EXWIIOIAI GC TSFNIF MHOLAHD IUSOY VARKHO HOTANANDASTT. CDODV HEEMS TN SOBE IETAREU WHNU ADE\n", + "OHLSHBE OHNWIR TRE TAUE AW YOLASSNO’S MEHTR, RNGEBEI ROH TULLESHNNH LSHTHAWEU RAT GAIK AND GE ROCE\n", + "WALAYEDER EGADEILE AC A SHVRDF ALAIGE PIOWF FAHVAIV WHUED MSUE IAUE HSLRANCED NI TSE NEYANN ONAMID\n", + "NHAETEEN AGEDYE. WIMAITMNOTEDF, OT TEECN TSOT TRE SSORAF OILSIGE IETBSSK BAH VY TRAS HAHVE\n", + "NMVYSSTAHY ONMEU ONTUSIELTHSO NI TSE NEYANN, OAU FE GELIEGE TSOT ITN ALAIAHN YIG DNGE LOITSNVMTER,\n", + "NT LEITT IHUODELTDF, TO ADE EYENAO DEODAIV TA TRE FISST PORWU FOI. TSIH WOLT OWAHE LOWWU LOMHE\n", + "LAHNOMENNPLE EUCNIHAHTPEHT TO ADE MK FOPESHWENA HOU BE FEED FE RIPE OA SWTHSO PMT TN NELSYUEAU TRAT\n", + "ADE SRAMNG NIDRAPE NHU ARL ITS IETBSSKN SSNUDU VE GNUOU MW, AAO UADMUEATS OHILYHEU, LROOHNCOED, HOU,\n", + "AB NELESNADG, RESTIOGEU, OID AAO NSNETT RISGNHER AW. TRAT NEBSIT TDAMLD ILOA IEYIHA LDOSHHMIEU BOR H\n", + "CEHOOD SY OT UEOOT SECEITB-WACE GENIN. PE BSWDU IEMSMCEHM O FWPLOLOTIAI DIAE AW TPO ADAMNAND HOU\n", + "TPEITB-WACE OT EOHUAEOT. NI TSE PEOITAUE, IT NROWWU PE WDEOEIYEM WOIHP TSE DIYREHA OELMIAAY\n", + "NGOOROCDE; AT GNUDU CNDU TRE WNHA LACGIOUIHNIF UOTEIAAR HM IT NROWWU WOUR HATA EHEUY ROIDH.\n" + ] + } + ], + "source": [ + "print(lcat(tpack(repunctuate(combine_every_nth(p_splits), ptb).split())))" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'f': 'e',\n", + " 'u': 't',\n", + " 'd': 'o',\n", + " 'j': 'a',\n", + " 'p': 'i',\n", + " 'h': 'n',\n", + " 'w': 'h',\n", + " 't': 's',\n", + " 'a': 'r',\n", + " 'e': 'd',\n", + " 'm': 'l',\n", + " 'o': 'u',\n", + " 'v': 'm',\n", + " 'n': 'w',\n", + " 'x': 'y',\n", + " 'g': 'c',\n", + " 'z': 'f',\n", + " 'q': 'g',\n", + " 'i': 'p',\n", + " 'b': 'b',\n", + " 'c': 'v',\n", + " 'l': 'k',\n", + " 'y': 'x'},\n", + " {'s': 'e',\n", + " 'j': 't',\n", + " 'd': 'o',\n", + " 'i': 'a',\n", + " 't': 'i',\n", + " 'v': 'n',\n", + " 'q': 'h',\n", + " 'e': 's',\n", + " 'r': 'r',\n", + " 'u': 'd',\n", + " 'z': 'l',\n", + " 'b': 'u',\n", + " 'k': 'm',\n", + " 'f': 'w',\n", + " 'l': 'y',\n", + " 'c': 'c',\n", + " 'a': 'f',\n", + " 'y': 'g',\n", + " 'x': 'p',\n", + " 'h': 'b',\n", + " 'w': 'v',\n", + " 'n': 'k',\n", + " 'g': 'x',\n", + " 'm': 'j'},\n", + " {'i': 'e',\n", + " 'x': 't',\n", + " 'l': 'o',\n", + " 'c': 'a',\n", + " 'w': 'i',\n", + " 'r': 'n',\n", + " 'd': 'h',\n", + " 'o': 's',\n", + " 'p': 'r',\n", + " 'v': 'd',\n", + " 'g': 'l',\n", + " 'q': 'u',\n", + " 'b': 'm',\n", + " 'y': 'w',\n", + " 'h': 'y',\n", + " 'k': 'c',\n", + " 'e': 'f',\n", + " 'j': 'g',\n", + " 'f': 'p',\n", + " 't': 'b',\n", + " 'z': 'v',\n", + " 's': 'k',\n", + " 'n': 'x',\n", + " 'm': 'j'},\n", + " {'n': 'e',\n", + " 'a': 't',\n", + " 'e': 'o',\n", + " 'g': 'a',\n", + " 'y': 'i',\n", + " 'j': 'n',\n", + " 'r': 'h',\n", + " 'f': 's',\n", + " 'h': 'r',\n", + " 'i': 'd',\n", + " 'v': 'l',\n", + " 'x': 'u',\n", + " 'm': 'm',\n", + " 'd': 'w',\n", + " 'z': 'y',\n", + " 'q': 'c',\n", + " 'b': 'f',\n", + " 'p': 'g',\n", + " 'o': 'p',\n", + " 'k': 'b',\n", + " 'l': 'v',\n", + " 'u': 'k',\n", + " 'w': 'x',\n", + " 's': 'j'},\n", + " {'p': 'e',\n", + " 'd': 't',\n", + " 'f': 'o',\n", + " 'z': 'a',\n", + " 't': 'i',\n", + " 'a': 'n',\n", + " 'k': 'h',\n", + " 'i': 's',\n", + " 'j': 'r',\n", + " 'g': 'd',\n", + " 'n': 'l',\n", + " 'o': 'u',\n", + " 'q': 'm',\n", + " 'x': 'w',\n", + " 'c': 'y',\n", + " 's': 'c',\n", + " 'm': 'f',\n", + " 'y': 'g',\n", + " 'w': 'p',\n", + " 'l': 'b',\n", + " 'r': 'v',\n", + " 'v': 'k',\n", + " 'u': 'x',\n", + " 'b': 'j'},\n", + " {'o': 'e',\n", + " 'n': 't',\n", + " 'j': 'o',\n", + " 's': 'a',\n", + " 'c': 'i',\n", + " 'y': 'n',\n", + " 'm': 'h',\n", + " 'x': 's',\n", + " 'v': 'r',\n", + " 'g': 'd',\n", + " 'd': 'l',\n", + " 'z': 'u',\n", + " 'i': 'm',\n", + " 'p': 'w',\n", + " 'w': 'y',\n", + " 'h': 'c',\n", + " 'k': 'f',\n", + " 'q': 'g',\n", + " 'a': 'p',\n", + " 't': 'b',\n", + " 'b': 'v',\n", + " 'f': 'k',\n", + " 'e': 'x',\n", + " 'l': 'j',\n", + " 'r': 'q'},\n", + " {'k': 'e',\n", + " 'z': 't',\n", + " 'c': 'o',\n", + " 'f': 'a',\n", + " 'y': 'i',\n", + " 'n': 'n',\n", + " 'w': 'h',\n", + " 'u': 's',\n", + " 'b': 'r',\n", + " 'r': 'd',\n", + " 'j': 'l',\n", + " 'e': 'u',\n", + " 's': 'm',\n", + " 'l': 'w',\n", + " 'm': 'y',\n", + " 't': 'c',\n", + " 'g': 'f',\n", + " 'h': 'g',\n", + " 'i': 'p',\n", + " 'v': 'b',\n", + " 'd': 'v',\n", + " 'q': 'k',\n", + " 'a': 'x'}]" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "split_counts = [collections.Counter(s) for s in splits]\n", + "split_maps = [{c: p for ((c, _), (p, _)) in zip(s.most_common(), english_counts.most_common())} for s in split_counts]\n", + "split_maps" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": {}, + "outputs": [], + "source": [ + "split_trans = [''.maketrans(sm) for sm in split_maps]\n", + "split_plain = [s.translate(st) for (s, st) in zip(splits, split_trans)]\n", + "split_plain;" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [], + "source": [ + "# print(repunctuate(combine_every_nth(split_plain), ptb))" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [], + "source": [ + "def repack(punctuation):\n", + " def ischar(elem):\n", + " return elem in ['UPPER', 'LOWER']\n", + " \n", + " repacked = []\n", + " for p, np in zip(punctuation, (punctuation[1:] + [' '])):\n", + " if ischar(p):\n", + " if ischar(np):\n", + " repacked += [p, ' ']\n", + " elif np == ' ':\n", + " repacked += [p, '*']\n", + " else:\n", + " repacked += [p, np]\n", + "# elif p == ' ':\n", + "# repacked += ['*', ' ']\n", + " return repacked\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'A B;C D*'" + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "repunctuate('abcd', repack(['UPPER', 'UPPER', ';', ' ', 'UPPER', 'UPPER', ' ', 'UPPER']))" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " etoainhsrdlumwycfgpbvkxjqz\n", + "0: fudjphwtaemovnxgzqibcly\n", + "1: sjditvqeruzbkflcayxhwngm\n", + "2: ixlcwrdopvgqbyhkejftzsnm\n", + "3: naegyjrfhivxmdzqbpokluws\n", + "4: pdfztakijgnoqxcsmywlrvub\n", + "5: onjscymxvgdzipwhkqatbfelr\n", + "6: kzcfynwubrjeslmtghivdqa\n", + "\n" + ] + } + ], + "source": [ + "ms = ' ' + cat(p[0] for p in english_counts.most_common()) +'\\n'\n", + "for i, c in enumerate(split_counts):\n", + " ms += '{}: {}\\n'.format(i, cat(p[0] for p in c.most_common()))\n", + "print(ms)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'f': 'e',\n", + " 'u': 't',\n", + " 'd': 'o',\n", + " 'j': 'a',\n", + " 'p': 'i',\n", + " 'h': 'n',\n", + " 'w': 'h',\n", + " 't': 's',\n", + " 'a': 'r',\n", + " 'e': 'd',\n", + " 'm': 'l',\n", + " 'o': 'u',\n", + " 'v': 'm',\n", + " 'n': 'w',\n", + " 'x': 'y',\n", + " 'g': 'c',\n", + " 'z': 'f',\n", + " 'q': 'g',\n", + " 'i': 'p',\n", + " 'b': 'b',\n", + " 'c': 'v',\n", + " 'l': 'k',\n", + " 'y': 'x'},\n", + " {'s': 'e',\n", + " 'j': 't',\n", + " 'd': 'o',\n", + " 'i': 'a',\n", + " 't': 'i',\n", + " 'v': 'n',\n", + " 'q': 'h',\n", + " 'e': 's',\n", + " 'r': 'r',\n", + " 'u': 'd',\n", + " 'z': 'l',\n", + " 'b': 'u',\n", + " 'k': 'm',\n", + " 'f': 'w',\n", + " 'l': 'y',\n", + " 'c': 'c',\n", + " 'a': 'f',\n", + " 'y': 'g',\n", + " 'x': 'p',\n", + " 'h': 'b',\n", + " 'w': 'v',\n", + " 'n': 'k',\n", + " 'g': 'x',\n", + " 'm': 'j'},\n", + " {'i': 'e',\n", + " 'x': 't',\n", + " 'l': 'o',\n", + " 'c': 'a',\n", + " 'w': 'i',\n", + " 'r': 'n',\n", + " 'd': 'h',\n", + " 'o': 's',\n", + " 'p': 'r',\n", + " 'v': 'd',\n", + " 'g': 'l',\n", + " 'q': 'u',\n", + " 'b': 'm',\n", + " 'y': 'w',\n", + " 'h': 'y',\n", + " 'k': 'c',\n", + " 'e': 'f',\n", + " 'j': 'g',\n", + " 'f': 'p',\n", + " 't': 'b',\n", + " 'z': 'v',\n", + " 's': 'k',\n", + " 'n': 'x',\n", + " 'm': 'j'},\n", + " {'n': 'e',\n", + " 'a': 't',\n", + " 'e': 'o',\n", + " 'g': 'a',\n", + " 'y': 'i',\n", + " 'j': 'n',\n", + " 'r': 'h',\n", + " 'f': 's',\n", + " 'h': 'r',\n", + " 'i': 'd',\n", + " 'v': 'l',\n", + " 'x': 'u',\n", + " 'm': 'm',\n", + " 'd': 'w',\n", + " 'z': 'y',\n", + " 'q': 'c',\n", + " 'b': 'f',\n", + " 'p': 'g',\n", + " 'o': 'p',\n", + " 'k': 'b',\n", + " 'l': 'v',\n", + " 'u': 'k',\n", + " 'w': 'x',\n", + " 's': 'j'},\n", + " {'p': 'e',\n", + " 'd': 't',\n", + " 'f': 'o',\n", + " 'z': 'a',\n", + " 't': 'i',\n", + " 'a': 'n',\n", + " 'k': 'h',\n", + " 'i': 's',\n", + " 'j': 'r',\n", + " 'g': 'd',\n", + " 'n': 'l',\n", + " 'o': 'u',\n", + " 'q': 'm',\n", + " 'x': 'w',\n", + " 'c': 'y',\n", + " 's': 'c',\n", + " 'm': 'f',\n", + " 'y': 'g',\n", + " 'w': 'p',\n", + " 'l': 'b',\n", + " 'r': 'v',\n", + " 'v': 'k',\n", + " 'u': 'x',\n", + " 'b': 'j'},\n", + " {'o': 'e',\n", + " 'n': 't',\n", + " 'j': 'o',\n", + " 's': 'a',\n", + " 'c': 'i',\n", + " 'y': 'n',\n", + " 'm': 'h',\n", + " 'x': 's',\n", + " 'v': 'r',\n", + " 'g': 'd',\n", + " 'd': 'l',\n", + " 'z': 'u',\n", + " 'i': 'm',\n", + " 'p': 'w',\n", + " 'w': 'y',\n", + " 'h': 'c',\n", + " 'k': 'f',\n", + " 'q': 'g',\n", + " 'a': 'p',\n", + " 't': 'b',\n", + " 'b': 'v',\n", + " 'f': 'k',\n", + " 'e': 'x',\n", + " 'l': 'j',\n", + " 'r': 'q'},\n", + " {'k': 'e',\n", + " 'z': 't',\n", + " 'c': 'o',\n", + " 'f': 'a',\n", + " 'y': 'i',\n", + " 'n': 'n',\n", + " 'w': 'h',\n", + " 'u': 's',\n", + " 'b': 'r',\n", + " 'r': 'd',\n", + " 'j': 'l',\n", + " 'e': 'u',\n", + " 's': 'm',\n", + " 'l': 'w',\n", + " 'm': 'y',\n", + " 't': 'c',\n", + " 'g': 'f',\n", + " 'h': 'g',\n", + " 'i': 'p',\n", + " 'v': 'b',\n", + " 'd': 'v',\n", + " 'q': 'k',\n", + " 'a': 'x'}]" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "split_counts = [collections.Counter(s) for s in splits]\n", + "split_maps = [{c: p for ((c, _), (p, _)) in zip(s.most_common(), english_counts.most_common())} for s in split_counts]\n", + "split_maps" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SEBNNT AI TSE ERTOGRHOSCEST, EMYEDTOPEOENH IIR RTOSMHAV AC TSE OSOUNF ANLRAYE; BITR SELNGMEIDITIASN.\n", + "BAR YAMS EYEO ASLK. TSIR IEWART CON LAUGIHNOAIEU PF TSE MAIEOCI OELSETANB TH AEYHHT HS TSE\n", + "RTSMLTUHEN IND SLTAYOTIEH HB TSE JMOHO-HAUEGENDEOT ASTEWDNPENME NYESLF, TSE NRIDHC OSLSHPE,\n", + "REAEAMTES AEGEHIED TN SR TRE IRLSNYE. TSE HEGNDT LASTIOIO HEDNUUEOUOTONAR WHA IMTIAIH LNALESSOIV TRE\n", + "IDMDIGE, IH BEDD OH I OUMCOAY NM DENHAIO DEOANER YIHC IISDVNOH NM ITN ILTIGNTOEO. IT OLHA MHOTOONO S\n", + "PIAEG OUMCOAY NM TRE LWRNEST IHOETH HB TSE NIDROPE NSU AEMHMCESMATIAIH IO TA TRE WOE AI UOHYHROL NG\n", + "TDAHE IHOETH. TRE ODNUHP IRLSNYE OO SO NIDEYEOUEST HATELUOCEOLE ICEALV NET WC PV TRE YNIGOTE\n", + "OELIETIRY TA RED USXENTY JUEEI YOMTAIAI OI TSE LITE EIYRTEEATR DENTUHV. AT FAO EHTIPLIRRED TN\n", + "LASUMLT OWIYEOLWNSDE IIR TA DIDRY AMT LAPEHT UOBLHMOTOL ALTNHSH DERNPSED TA WMATSEH TRE OITEIEHTO HY\n", + "REA UAXEHTK’H CHGESSUEAT, FRORE CHAYOMHAV OI EREGEST NG YWNMNOPLE UEIOIVIDNTK OI TSE EYEIT TROT OTO\n", + "NLTOVHTIEN PERE UNNLAPEHEU. HLAAT UHLWUEOTOTONA RTAUR EJIHTH GRHM TROH OTNYE NG TDE ENTIVWIHRCEIT AW\n", + "TRE ANLRAYE, TDAMPR CHPES TRE DEDNDITE ANTMAE NM ITN NBENNTANNO, IT COK PE TSOT YERY YEB HWMD\n", + "UADMUEATH BEDE EGES PDHTTEI. TSE MEF TRIT RA IECIHA NIE GY ISTMSE BRIGOTE LNGMMIOLATIAIH IIR\n", + "FESHAISD IELARRR. NI WIRTILMUIR TSESE IYCEOSH TN DNGE GEEA N LHADEOFAIDEILE PETFEEO REA UAXEHTK IIR\n", + "LROAREO VIEK LNALESSOIV TRE SEER YAS HWMD NS HACAAIHOTONA, TRHMCS HODF I GEB AW TRAOE DETTERO NIE NN\n", + "GIDE AS TSE FIAYITE HAFIR MHDDELTHHO. NT OH OUHCAHED TSOT NTSEH DETTENR LHSLENONIF TSE HEDAWHTMEIT\n", + "AG FDODV IO TSE CODOT SEOD AG TSE OALSIGE WMHT DNGE EKHOTEU, GWT SO EITORE PAX NG DHLMWENTO YIHC\n", + "TSST BEAONR IH WOHOIOY BOTS AA NIDEX MIDE TA TEDD MH FSST NT LAITNNIEM. NUH NIYEOTIYOTONAR NITA\n", + "VWNLK HSNB TROT SE BNH SERATEU TN CREB, OID TSST RE AETUHSED GRHM PHHTNA MONHIMDWHETTO TA TOVE WC\n", + "HENOMEALE AS RNAUAI. ROO IMCEDOATE WOCOLY CESE NNT CEOUTSY, TRHMCS DE ROD PEEO O SERATIGEUY\n", + "OULLEHHGUD LSOUHAND AS TSE WSATED OTOTEH, AAU LHSTEGFASIDF NELHAMO OWYPEHT TSOT RE SSU ENTIVWIHREM\n", + "HAUEGENDEOT WEIIO. OA SELNNU AC ROO EMBLNYUEOT DIN VE YAMSM, SHCEYED OEGESIR NM TRE EKTSOT UNLWGESTH\n", + "GRHM YSEY’O CEINNNAW LALUEMTIAI ROIT TROT PLSLK BIH RELIMOTER NH RED USXENTY’O MIINT HELHET\n", + "HEMNETOAY, OH TRE IPOEOLE NG AAB UHLWUEOTOTONA IH MSHWNFIAHOIV. PDOLX KEFT O WEROASOU JNUHSOU FSILR\n", + "DNNTSISED HNGE NITERERTASC DETOAUH, CIGNIF WO OACE ONOIVRT ONTH SNN WEROASOUOTY, NSU OT HO LDEID\n", + "TDNT RE TSNIGED AI SUGESTWNE. MIBARTWSOTELY, TRE YALUMEN AELSTNIF TN DIH GEDHHU NI UAIRAS OAE AWRA\n", + "WOHOIOY, NN FE LNSINT REDV HS TSEM TH BOLW IS TRE UIRHASC DETOAUH NM SNN AEMNWNTCEIT TA TRE ANLRAYE.\n", + "IHOETRELERH O SWUFEI HB WIHYWALOAW HEDNDDO MOASTAIOEU GY UEMPEAH NM TRE BAREIYI HEMNETOAY’O\n", + "REBOATUEOT NMCCERT TRIT TSE EJOOTESDE AG TSE OALSIGE, BROLE AWCOLHSDDF DEIIEU, BIH KAAFI TA A OMOLU\n", + "NWGPES NG UEMPEAH NM TRE ONTEDDAFEILE LHCUWAITF ON LHOUHS. OI CNITOLWWNI TRE EOTOVUOODMEIT AG\n", + "DEOUXWANTESH OI OLATUIIR BOSD FAO N IEUITIGELK AYEO HELDET, FIEHWUSPDF GEMSWHE TSE CADALE TDECNERPER\n", + "FEAE ABNIE TSAT RAWETSIOY MSWOUND BIH CHISP NN, TDAMPR TSE OOWE IIR NLTOVHTIEN NG TDE ASFIIIROTOAI\n", + "BEIE I LLHRELK CWSHUED HELHET. TSE ANCE HSARAF OALSIGE UNEO AAT OWBESH AI INF HYWALOAW UADMUEATH\n", + "CAAU TSE GEDHHU. ON TSE OLOLE AG FDODV’H NCEIOTONAR YSEF HA TRE COD EIYRTEEA REYENTIEH, SMUNUHH HB\n", + "OTO NLTOVHTIEN IROH VIEP IIR IT NEEUO TA RIVE FEEI TSHO, NH WMLS SR TRE NEEU TH EHTSPDAHS A OELMAE\n", + "LHLOTOAI MAI ROH CNAFASC MHDDELTHHO AC ONTEDDAFEILE BOWERO, TROT HEEMH TN SAPE DED PLSLK TN TSE\n", + "UEYERNCMEIT AG TSE MSMENVIHMND WNPFAOITS PESEATS TRE YANU. TRE EXTHOHAMHANIF LAOT AW TROO LAMLD NNT\n", + "PE GAAYEHDF LAILEOLEM AAU TROH LEU TH XWEOTNHSH HA TRE RAWOE FROLS IO TMAN, HM BAM POLW EXDMHE TSE\n", + "GMN, DNAGE TSE SHLROVE MWITRER UOUEACRHWSU. TSNOE YHYERAMEIT UHAIHTAOEO CRALS SSU RATSENTA VEEI\n", + "FESEBOMINIAEH NM TRE ONTEDDAFEILE UOTI AAU OIIRFOIH GAADULEU GY VWNLK’H AYEHOTOVEO OAB LAUCDETERF\n", + "RIHTINMEU TREUOEDGEH, IIR SE NEEUO TA RIVE FELHCE AA NDWNHT EOTAAELY YIEE ICEOT, NETTIOY ROH NBO\n", + "BHUOTILOL IND RIBLNUATIL PNILO CNTR TSE TODOT OUFBHAT NM TRE WILSLE. UMDHAV TROH YEHNHD, PLSLK BIH\n", + "GHLMNHED WNIPERF HO UEHTAFIDAHOIV HMNHOAA, VESCII SOU OMHTNIOI OUYEHNOUOOT EXGINOIAS AS TSE POLVIIO\n", + "HEPOAI, SOU HS TSE OEED TN CHATELT TSE WEMHTEISINESO TSIME NAMTEH. SE REECH TH SOYE MEPEDHWED SO\n", + "EXTEIOIGE SETBAIK NG AVESTH OI TSE SECHHO, PMT UNNE NWWARTNSTUY TH SOYE MEPEDHWED AEF WETSHUH HB\n", + "FNNKNIF. FSIDE DUIOOILOU MHCDAWILF DNU OUFAYR IEUOER AS EHBHHOOPE, PLSLK EHTAFDNNRED AEF DNVENT\n", + "CETSNRR TH DOONWBT TSE RIBLNUATIL OLTHPITAEH NM FATENTIND HWBNOITANN, VY FDOLOIV NYESTO BITRON TDENS\n", + "GWRENMDAIMIEH. DNNTNADLONC TSE OFEIRN AC OUYHHTOST HATESSITIASOU UEETNIFH, SE CON IPLE, NT LEIOT IS\n", + "GIDT, TA LHSTRHD TRE AWTLAWE AG AEYHTOATIAIH, IIR TA VENEMIT CAAU IOHADE KAAFLEMCE AW TRAOE\n", + "UELOPENNTANNO. DE ROD BANTNDMRAN RMDLEOO UMSONC TSE GEDHHU AC TSE FWDPIDHSO OID PAWKOIH LRIREN\n", + "DOONWBTONC TSE OURHSOLE GWHWUNIF PETCEES TSE TRSEE EGFESNDO. IY RE RID NEHTAOMTEU ROUOEDW TN\n", + "EIVNYASC BITR TRE USXAS WABEHH AS TSIR FOK SHO HEDNDD BAMLD SAPE PEEN REVOSDED SR O NOCIIYNDINT\n", + "OWLDEHO SOU TRE OUPTLETF HY RAH UETSAUH UAY CELU SAPE FHS SHG YIAENDO IS ROCS VAGEANUEOT. TRE\n", + "OKIDCMR BSB NI PSHLS RE CIIIFMLITER ISTEDISTNHSIL LASYENTIASN TA NUH PESEGIT OT YERY DNTTRE LAHT ON\n", + "LIGEN WDNGIHED TN ERTOGRHOS O IEF BSB AC PARKISP GY OUPTEAGWVE NIHTESU AC PIR. UOWHATWANTEUY SIR\n", + "GALTNNIEN ENMHWIOFED S MASE DELKDEHH ACFIHILS SOU RE HEEMH TN SAPE EXWRNNEU WNDE EQTSEUE PEINOAIO AW\n", + "DNVENT UAWRNGNLF. RERE HEDNDDO NT TRE ANLRAYE TEDD O CARE LAWWRETE HTNDF, TSAMFS GHH IEIHNAR TRIT\n", + "BIDD VELNGE LLEIR IO O WNUEAT, FE RIPE LRHHEI TA IECAPE NSU LRAORNCK, AR IO HHCE MSREN DEOTHAF,\n", + "TSNOE UHLWUEOTN PSHLS SOADATE NT. TSENE NN LRESH EYOMEALE TRIT FDODV HET WB MSOTO CNTROI TSE OALSIGE\n", + "TN WIREITIXE BSOT RIPE PEDNUE KOABS IO FDODV AYEHOTOAIO. (NH OS IOIUE, TRE ETBCHUACY AW TRIT ANCE\n", + "PIO AAT DUEAN WSTOR TDE OSLSHPE FOH WILAGEAED.) TSENE HYELNOUOOEU NI GRALKCOOR, VNIPEAY AAU\n", + "BHUOTILOL ICHTNTANN. BDIDE TSENE OSE NN NELHAMO HY RAFSEN LIACEO FENIF IWTSASOHER PV TRE ANLRAYE,\n", + "TDE ODTOPIRTN TSEY CASVED BITR PERE OAT IPNPE CMAMEN, NSU OT HO JMATE YNAPOGRE TSOT TSHO SOU GEMHME\n", + "OSATDEI TNAL HY TRE NETCASV. TSE DADIR CNAMGH HWCFASTED FB TRE IRLSNYE FENE BOATHLWDOARF SLTAYE HA\n", + "TRE GILKNS NTITER OT TSE EOU HB TSE ONIETEEOTR LEITWIF, IND FDODV GNLWHNEM NA TIFONC TA UAHDWCT\n", + "IMHHHSO EXWIIOIAI GY OHCNIF MHOLASD IUHOY VIRKSO SOTONANDAHTO. FDODV HEEMH TN SAPE IETOREU WSNU TDE\n", + "OSLSHPE OSNWIR TRE TOUE AW YOLTHHNO’H MESTR, RNFEPEI ROH OULLEHHNNR LHSTHAWEU ROO BAIK IND BE ROYE\n", + "WALAYEDER EGADEILE AC I SHVSDF ILTIGE PAAWC CASVOIV WSUED MHUE IIUE SHLRINCED NI TSE NEYANN ANAMID\n", + "NHAETEEN TBEDYE. WIMAITMNATEDF, OT OEECN TSAT TRE HSARAF OALSIGE IETBHHK BIH VY TRAH HTSVE\n", + "NMBYHHTASC ANMEU ONOUHIELTHHO NI TSE NEYANN, AAU FE GELIEGE TSAT ITN ILTIASN CIF DNGE LAITHNVMTER,\n", + "NT LEIOT ISUODELTDF, TA TDE EYENTO DEODOIV TA TRE GIHHT PARWU FOA. TSIR WOLT AWASE LAWWU LOMHE\n", + "LASNOMENNPLE EUFNISIHOGEST TA TDE MK FAPEHSWENT SOU BE GEED FE RIPE OA HWTHHO PMT TN NELHCUEAU TRIT\n", + "TDE HRIMNB NIDROPE NSU IRL ITH IETBHHKN HSNUDU VE FNUOU MW, OTO UADMUEATH OSILYREU, LRAORNCOED, SOU,\n", + "AB NELEHNIDF, REHTAAFEU, OID OTO NHNETO RIHGNHER AW. TROO NEBHAT ODAMLD ILOA IECIHA LDOHHHMIEU BAR S\n", + "FESOAD HY OT UEAOT HEYEITB-WAYE FENIN. PE BHWDU AEMHMCESM A CWPLOLATIAI DITE AW TPA TDAMNIND SOU\n", + "TPEITB-WAYE AT EOSUOEOT. NI TSE GEOITOUE, IT NRAWWU PE WDEOEIYEM WOISP TSE DIYREHT OELMAOTY\n", + "NGOORAFDE; AT FNUDU CNDU TSE WNHT LACGAAUIRNIF UATEIAIR HM IT NRAWWU WOUR HATA ESEUY SOIDH.\n" + ] + } + ], + "source": [ + "# chunks(repunctuate(combine_every_nth(split_plain), repack(ptb)), 14)\n", + "print(lcat(tpack(repunctuate(combine_every_nth(split_plain), ptb).split())))" + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['S E B N N T*A I*T S E*E R T O G R H O S C E S T,E M Y E ',\n", + " 'D T O P E O E N H*I I R*R T O S M H A V*A C*T S E*O S O ',\n", + " 'U N F*A N L R A Y E;B I T R*S E L N G M E I D I T I A S ',\n", + " 'N.B A R*Y A M S*E Y E O*A S L K.T S I R*I E W A R T*C O ',\n", + " 'N*L A U G I H N O A I E U*P F*T S E*M A I E O C I*O E L ',\n", + " 'S E T A N B*T H*A E Y H H T*H S*T S E*R T S M L T U H E ',\n", + " 'N*I N D*S L T A Y O T I E H*H B*T S E*J M O H O-H A U E ',\n", + " 'G E N D E O T*A S T E W D N P E N M E*N Y E S L F,T S E*',\n", + " 'N R I D H C*O S L S H P E,R E A E A M T E S*A E G E H I ',\n", + " 'E D*T N*S R*T R E*I R L S N Y E.T S E*H E G N D T*L A S ',\n", + " 'T I O I O*H E D N U U E O U O T O N A R*W H A*I M T I A ',\n", + " 'I H*L N A L E S S O I V*T R E*I D M D I G E,I H*B E D D*',\n", + " 'O H*I*O U M C O A Y*N M*D E N H A I O*D E O A N E R*Y I ',\n", + " 'H C*I I S D V N O H*N M*I T N*I L T I G N T O E O.I T*O ',\n", + " 'L H A*M H O T O O N O*S*P I A E G*O U M C O A Y*N M*T R ',\n", + " 'E*L W R N E S T*I H O E T H*H B*T S E*N I D R O P E*N S ',\n", + " 'U*A E M H M C E S M A T I A I H*I O*T A*T R E*W O E*A I*',\n", + " 'U O H Y H R O L*N G*T D A H E*I H O E T H.T R E*O D N U ',\n", + " 'H P*I R L S N Y E*O O*S O*N I D E Y E O U E S T*H A T E ',\n", + " 'L U O C E O L E*I C E A L V*N E T*W C*P V*T R E*Y N I G ',\n", + " 'O T E*O E L I E T I R Y*T A*R E D*U S X E N T Y*J U E E ',\n", + " 'I*Y O M T A I A I*O I*T S E*L I T E*E I Y R T E E A T R*',\n", + " 'D E N T U H V.A T*F A O*E H T I P L I R R E D*T N*L A S ',\n", + " 'U M L T*O W I Y E O L W N S D E*I I R*T A*D I D R Y*A M ',\n", + " 'T*L A P E H T*U O B L H M O T O L*A L T N H S H*D E R N ',\n", + " 'P S E D*T A*W M A T S E H*T R E*O I T E I E H T O*H Y*R ',\n", + " 'E A*U A X E H T K’H*C H G E S S U E A T,F R O R E*C H A ',\n", + " 'Y O M H A V*O I*E R E G E S T*N G*Y W N M N O P L E*U E ',\n", + " 'I O I V I D N T K*O I*T S E*E Y E I T*T R O T*O T O*N L ',\n", + " 'T O V H T I E N*P E R E*U N N L A P E H E U.H L A A T*U ',\n", + " 'H L W U E O T O T O N A*R T A U R*E J I H T H*G R H M*T ',\n", + " 'R O H*O T N Y E*N G*T D E*E N T I V W I H R C E I T*A W*',\n", + " 'T R E*A N L R A Y E,T D A M P R*C H P E S*T R E*D E D N ',\n", + " 'D I T E*A N T M A E*N M*I T N*N B E N N T A N N O,I T*C ',\n", + " 'O K*P E*T S O T*Y E R Y*Y E B*H W M D*U A D M U E A T H*',\n", + " 'B E D E*E G E S*P D H T T E I.T S E*M E F*T R I T*R A*I ',\n", + " 'E C I H A*N I E*G Y*I S T M S E*B R I G O T E*L N G M M ',\n", + " 'I O L A T I A I H*I I R*F E S H A I S D*I E L A R R R.N ',\n", + " 'I*W I R T I L M U I R*T S E S E*I Y C E O S H*T N*D N G ',\n", + " 'E*G E E A*N*L H A D E O F A I D E I L E*P E T F E E O*R ',\n", + " 'E A*U A X E H T K*I I R*L R O A R E O*V I E K*L N A L E ',\n", + " 'S S O I V*T R E*S E E R*Y A S*H W M D*N S*H A C A A I H ',\n", + " 'O T O N A,T R H M C S*H O D F*I*G E B*A W*T R A O E*D E ',\n", + " 'T T E R O*N I E*N N*G I D E*A S*T S E*F I A Y I T E*H A ',\n", + " 'F I R*M H D D E L T H H O.N T*O H*O U H C A H E D*T S O ',\n", + " 'T*N T S E H*D E T T E N R*L H S L E N O N I F*T S E*H E ',\n", + " 'D A W H T M E I T*A G*F D O D V*I O*T S E*C O D O T*S E ',\n", + " 'O D*A G*T S E*O A L S I G E*W M H T*D N G E*E K H O T E ',\n", + " 'U,G W T*S O*E I T O R E*P A X*N G*D H L M W E N T O*Y I ',\n", + " 'H C*T S S T*B E A O N R*I H*W O H O I O Y*B O T S*A A*N ',\n", + " 'I D E X*M I D E*T A*T E D D*M H*F S S T*N T*L A I T N N ',\n", + " 'I E M.N U H*N I Y E O T I Y O T O N A R*N I T A*V W N L ',\n", + " 'K*H S N B*T R O T*S E*B N H*S E R A T E U*T N*C R E B,O ',\n", + " 'I D*T S S T*R E*A E T U H S E D*G R H M*P H H T N A*M O ',\n", + " 'N H I M D W H E T T O*T A*T O V E*W C*H E N O M E A L E*',\n", + " 'A S*R N A U A I.R O O*I M C E D O A T E*W O C O L Y*C E ',\n", + " 'S E*N N T*C E O U T S Y,T R H M C S*D E*R O D*P E E O*O*',\n", + " 'S E R A T I G E U Y*O U L L E H H G U D*L S O U H A N D*',\n", + " 'A S*T S E*W S A T E D*O T O T E H,A A U*L H S T E G F A ',\n", + " 'S I D F*N E L H A M O*O W Y P E H T*T S O T*R E*S S U*E ',\n", + " 'N T I V W I H R E M*H A U E G E N D E O T*W E I I O.O A*',\n", + " 'S E L N N U*A C*R O O*E M B L N Y U E O T*D I N*V E*Y A ',\n", + " 'M S M,S H C E Y E D*O E G E S I R*N M*T R E*E K T S O T*',\n", + " 'U N L W G E S T H*G R H M*Y S E Y’O*C E I N N N A W*L A ',\n", + " 'L U E M T I A I*R O I T*T R O T*P L S L K*B I H*R E L I ',\n", + " 'M O T E R*N H*R E D*U S X E N T Y’O*M I I N T*H E L H E ',\n", + " 'T*H E M N E T O A Y,O H*T R E*I P O E O L E*N G*A A B*U ',\n", + " 'H L W U E O T O T O N A*I H*M S H W N F I A H O I V.P D ',\n", + " 'O L X*K E F T*O*W E R O A S O U*J N U H S O U*F S I L R*',\n", + " 'D N N T S I S E D*H N G E*N I T E R E R T A S C*D E T O ',\n", + " 'A U H,C I G N I F*W O*O A C E*O N O I V R T*O N T H*S N ',\n", + " 'N*W E R O A S O U O T Y,N S U*O T*H O*L D E I D*T D N T*',\n", + " 'R E*T S N I G E D*A I*S U G E S T W N E.M I B A R T W S ',\n", + " 'O T E L Y,T R E*Y A L U M E N*A E L S T N I F*T N*D I H*',\n", + " 'G E D H H U*N I*U A I R A S*O A E*A W R A*W O H O I O Y,',\n", + " 'N N*F E*L N S I N T*R E D V*H S*T S E M*T H*B O L W*I S*',\n", + " 'T R E*U I R H A S C*D E T O A U H*N M*S N N*A E M N W N ',\n", + " 'T C E I T*T A*T R E*A N L R A Y E.I H O E T R E L E R H*',\n", + " 'O*S W U F E I*H B*W I H Y W A L O A W*H E D N D D O*M O ',\n", + " 'A S T A I O E U*G Y*U E M P E A H*N M*T R E*B A R E I Y ',\n", + " 'I*H E M N E T O A Y’O*R E B O A T U E O T*N M C C E R T*',\n", + " 'T R I T*T S E*E J O O T E S D E*A G*T S E*O A L S I G E,',\n", + " 'B R O L E*A W C O L H S D D F*D E I I E U,B I H*K A A F ',\n", + " 'I*T A*A*O M O L U*N W G P E S*N G*U E M P E A H*N M*T R ',\n", + " 'E*O N T E D D A F E I L E*L H C U W A I T F*O N*L H O U ',\n", + " 'H S.O I*C N I T O L W W N I*T R E*E O T O V U O O D M E ',\n", + " 'I T*A G*D E O U X W A N T E S H*O I*O L A T U I I R*B O ',\n", + " 'S D*F A O*N*I E U I T I G E L K*A Y E O*H E L D E T,F I ',\n", + " 'E H W U S P D F*G E M S W H E*T S E*C A D A L E*T D E C ',\n", + " 'N E R P E R*F E A E*A B N I E*T S A T*R A W E T S I O Y*',\n", + " 'M S W O U N D*B I H*C H I S P*N N,T D A M P R*T S E*O O ',\n", + " 'W E*I I R*N L T O V H T I E N*N G*T D E*A S F I I I R O ',\n", + " 'T O A I*B E I E*I*L L H R E L K*C W S H U E D*H E L H E ',\n", + " 'T.T S E*A N C E*H S A R A F*O A L S I G E*U N E O*A A T*',\n", + " 'O W B E S H*A I*I N F*H Y W A L O A W*U A D M U E A T H*',\n", + " 'C A A U*T S E*G E D H H U.O N*T S E*O L O L E*A G*F D O ',\n", + " 'D V’H*N C E I O T O N A R*Y S E F*H A*T R E*C O D*E I Y ',\n", + " 'R T E E A*R E Y E N T I E H,S M U N U H H*H B*O T O*N L ',\n", + " 'T O V H T I E N*I R O H*V I E P*I I R*I T*N E E U O*T A*',\n", + " 'R I V E*F E E I*T S H O,N H*W M L S*S R*T R E*N E E U*T ',\n", + " 'H*E H T S P D A H S*A*O E L M A E*L H L O T O A I*M A I*',\n", + " 'R O H*C N A F A S C*M H D D E L T H H O*A C*O N T E D D ',\n", + " 'A F E I L E*B O W E R O,T R O T*H E E M H*T N*S A P E*D ',\n", + " 'E D*P L S L K*T N*T S E*U E Y E R N C M E I T*A G*T S E*',\n", + " 'M S M E N V I H M N D*W N P F A O I T S*P E S E A T S*T ',\n", + " 'R E*Y A N U.T R E*E X T H O H A M H A N I F*L A O T*A W*',\n", + " 'T R O O*L A M L D*N N T*P E*G A A Y E H D F*L A I L E O ',\n", + " 'L E M*A A U*T R O H*L E U*T H*X W E O T N H S H*H A*T R ',\n", + " 'E*R A W O E*F R O L S*I O*T M A N,H M*B A M*P O L W*E X ',\n", + " 'D M H E*T S E*G M N,D N A G E*T S E*S H L R O V E*M W I ',\n", + " 'T R E R*U O U E A C R H W S U.T S N O E*Y H Y E R A M E ',\n", + " 'I T*U H A I H T A O E O*C R A L S*S S U*R A T S E N T A*',\n", + " 'V E E I*F E S E B O M I N I A E H*N M*T R E*O N T E D D ',\n", + " 'A F E I L E*U O T I*A A U*O I I R F O I H*G A A D U L E ',\n", + " 'U*G Y*V W N L K’H*A Y E H O T O V E O*O A B*L A U C D E ',\n", + " 'T E R F*R I H T I N M E U*T R E U O E D G E H,I I R*S E*',\n", + " 'N E E U O*T A*R I V E*F E L H C E*A A*N D W N H T*E O T ',\n", + " 'A A E L Y*Y I E E*I C E O T,N E T T I O Y*R O H*N B O*B ',\n", + " 'H U O T I L O L*I N D*R I B L N U A T I L*P N I L O*C N ',\n", + " 'T R*T S E*T O D O T*O U F B H A T*N M*T R E*W I L S L E.',\n", + " 'U M D H A V*T R O H*Y E H N H D,P L S L K*B I H*G H L M ',\n", + " 'N H E D*W N I P E R F*H O*U E H T A F I D A H O I V*H M ',\n", + " 'N H O A A,V E S C I I*S O U*O M H T N I O I*O U Y E H N ',\n", + " 'O U O O T*E X G I N O I A S*A S*T S E*P O L V I I O*H E ',\n", + " 'P O A I,S O U*H S*T S E*O E E D*T N*C H A T E L T*T S E*',\n", + " 'W E M H T E I S I N E S O*T S I M E*N A M T E H.S E*R E ',\n", + " 'E C H*T H*S O Y E*M E P E D H W E D*S O*E X T E I O I G ',\n", + " 'E*S E T B A I K*N G*A V E S T H*O I*T S E*S E C H H O,P ',\n", + " 'M T*U N N E*N W W A R T N S T U Y*T H*S O Y E*M E P E D ',\n", + " 'H W E D*A E F*W E T S H U H*H B*F N N K N I F.F S I D E*',\n", + " 'D U I O O I L O U*M H C D A W I L F*D N U*O U F A Y R*I ',\n", + " 'E U O E R*A S*E H B H H O O P E,P L S L K*E H T A F D N ',\n", + " 'N R E D*A E F*D N V E N T*C E T S N R R*T H*D O O N W B ',\n", + " 'T*T S E*R I B L N U A T I L*O L T H P I T A E H*N M*F A ',\n", + " 'T E N T I N D*H W B N O I T A N N,V Y*F D O L O I V*N Y ',\n", + " 'E S T O*B I T R O N*T D E N S*G W R E N M D A I M I E H.',\n", + " 'D N N T N A D L O N C*T S E*O F E I R N*A C*O U Y H H T ',\n", + " 'O S T*H A T E S S I T I A S O U*U E E T N I F H,S E*C O ',\n", + " 'N*I P L E,N T*L E I O T*I S*G I D T,T A*L H S T R H D*T ',\n", + " 'R E*A W T L A W E*A G*A E Y H T O A T I A I H,I I R*T A*',\n", + " 'V E N E M I T*C A A U*I O H A D E*K A A F L E M C E*A W*',\n", + " 'T R A O E*U E L O P E N N T A N N O.D E*R O D*B A N T N ',\n", + " 'D M R A N*R M D L E O O*U M S O N C*T S E*G E D H H U*A ',\n", + " 'C*T S E*F W D P I D H S O*O I D*P A W K O I H*L R I R E ',\n", + " 'N*D O O N W B T O N C*T S E*O U R H S O L E*G W H W U N ',\n", + " 'I F*P E T C E E S*T S E*T R S E E*E G F E S N D O.I Y*R ',\n", + " 'E*R I D*N E H T A O M T E U*R O U O E D W*T N*E I V N Y ',\n", + " 'A S C*B I T R*T R E*U S X A S*W A B E H H*A S*T S I R*F ',\n", + " 'O K*S H O*H E D N D D*B A M L D*S A P E*P E E N*R E V O ',\n", + " 'S D E D*S R*O*N O C I I Y N D I N T*O W L D E H O*S O U*',\n", + " 'T R E*O U P T L E T F*H Y*R A H*U E T S A U H*U A Y*C E ',\n", + " 'L U*S A P E*F H S*S H G*Y I A E N D O*I S*R O C S*V A G ',\n", + " 'E A N U E O T.T R E*O K I D C M R*B S B*N I*P S H L S*R ',\n", + " 'E*C I I I F M L I T E R*I S T E D I S T N H S I L*L A S ',\n", + " 'Y E N T I A S N*T A*N U H*P E S E G I T*O T*Y E R Y*D N ',\n", + " 'T T R E*L A H T*O N*L I G E N*W D N G I H E D*T N*E R T ',\n", + " 'O G R H O S*O*I E F*B S B*A C*P A R K I S P*G Y*O U P T ',\n", + " 'E A G W V E*N I H T E S U*A C*P I R.U O W H A T W A N T ',\n", + " 'E U Y*S I R*G A L T N N I E N*E N M H W I O F E D*S*M A ',\n", + " 'S E*D E L K D E H H*A C F I H I L S*S O U*R E*H E E M H*',\n", + " 'T N*S A P E*E X W R N N E U*W N D E*E Q T S E U E*P E I ',\n", + " 'N O A I O*A W*D N V E N T*U A W R N G N L F.R E R E*H E ',\n", + " 'D N D D O*N T*T R E*A N L R A Y E*T E D D*O*C A R E*L A ',\n", + " 'W W R E T E*H T N D F,T S A M F S*G H H*I E I H N A R*T ',\n", + " 'R I T*B I D D*V E L N G E*L L E I R*I O*O*W N U E A T,F ',\n", + " 'E*R I P E*L R H H E I*T A*I E C A P E*N S U*L R A O R N ',\n", + " 'C K,A R*I O*H H C E*M S R E N*D E O T H A F,T S N O E*U ',\n", + " 'H L W U E O T N*P S H L S*S O A D A T E*N T.T S E N E*N ',\n", + " 'N*L R E S H*E Y O M E A L E*T R I T*F D O D V*H E T*W B*',\n", + " 'M S O T O*C N T R O I*T S E*O A L S I G E*T N*W I R E I ',\n", + " 'T I X E*B S O T*R I P E*P E D N U E*K O A B S*I O*F D O ',\n", + " 'D V*A Y E H O T O A I O.N H*O S*I O I U E,T R E*E T B C ',\n", + " 'H U A C Y*A W*T R I T*A N C E*P I O*A A T*D U E A N*W S ',\n", + " 'T O R*T D E*O S L S H P E*F O H*W I L A G E A E D.T S E ',\n", + " 'N E*H Y E L N O U O O E U*N I*G R A L K C O O R,V N I P ',\n", + " 'E A Y*A A U*B H U O T I L O L*I C H T N T A N N.B D I D ',\n", + " 'E*T S E N E*O S E*N N*N E L H A M O*H Y*R A F S E N*L I ',\n", + " 'A C E O*F E N I F*I W T S A S O H E R*P V*T R E*A N L R ',\n", + " 'A Y E,T D E*O D T O P I R T N*T S E Y*C A S V E D*B I T ',\n", + " 'R*P E R E*O A T*I P N P E*C M A M E N,N S U*O T*H O*J M ',\n", + " 'A T E*Y N A P O G R E*T S O T*T S H O*S O U*G E M H M E*',\n", + " 'O S A T D E I*T N A L*H Y*T R E*N E T C A S V.T S E*D A ',\n", + " 'D I R*C N A M G H*H W C F A S T E D*F B*T R E*I R L S N ',\n", + " 'Y E*F E N E*B O A T H L W D O A R F*S L T A Y E*H A*T R ',\n", + " 'E*G I L K N S*N T I T E R*O T*T S E*E O U*H B*T S E*O N ',\n", + " 'I E T E E O T R*L E I T W I F,I N D*F D O D V*G N L W H ',\n", + " 'N E M*N A*T I F O N C*T A*U A H D W C T*I M H H H S O*E ',\n", + " 'X W I I O I A I*G Y*O H C N I F*M H O L A S D*I U H O Y*',\n", + " 'V I R K S O*S O T O N A N D A H T O.F D O D V*H E E M H*',\n", + " 'T N*S A P E*I E T O R E U*W S N U*T D E*O S L S H P E*O ',\n", + " 'S N W I R*T R E*T O U E*A W*Y O L T H H N O’H*M E S T R,',\n", + " 'R N F E P E I*R O H*O U L L E H H N N R*L H S T H A W E ',\n", + " 'U*R O O*B A I K*I N D*B E*R O Y E*W A L A Y E D E R*E G ',\n", + " 'A D E I L E*A C*I*S H V S D F*I L T I G E*P A A W C*C A ',\n", + " 'S V O I V*W S U E D*M H U E*I I U E*S H L R I N C E D*N ',\n", + " 'I*T S E*N E Y A N N*A N A M I D*N H A E T E E N*T B E D ',\n", + " 'Y E.W I M A I T M N A T E D F,O T*O E E C N*T S A T*T R ',\n", + " 'E*H S A R A F*O A L S I G E*I E T B H H K*B I H*V Y*T R ',\n", + " 'A H*H T S V E*N M B Y H H T A S C*A N M E U*O N O U H I ',\n", + " 'E L T H H O*N I*T S E*N E Y A N N,A A U*F E*G E L I E G ',\n", + " 'E*T S A T*I T N*I L T I A S N*C I F*D N G E*L A I T H N ',\n", + " 'V M T E R,N T*L E I O T*I S U O D E L T D F,T A*T D E*E ',\n", + " 'Y E N T O*D E O D O I V*T A*T R E*G I H H T*P A R W U*F ',\n", + " 'O A.T S I R*W O L T*A W A S E*L A W W U*L O M H E*L A S ',\n", + " 'N O M E N N P L E*E U F N I S I H O G E S T*T A*T D E*M ',\n", + " 'K*F A P E H S W E N T*S O U*B E*G E E D*F E*R I P E*O A*',\n", + " 'H W T H H O*P M T*T N*N E L H C U E A U*T R I T*T D E*H ',\n", + " 'R I M N B*N I D R O P E*N S U*I R L*I T H*I E T B H H K ',\n", + " 'N*H S N U D U*V E*F N U O U*M W,O T O*U A D M U E A T H*',\n", + " 'O S I L Y R E U,L R A O R N C O E D,S O U,A B*N E L E H ',\n", + " 'N I D F,R E H T A A F E U,O I D*O T O*N H N E T O*R I H ',\n", + " 'G N H E R*A W.T R O O*N E B H A T*O D A M L D*I L O A*I ',\n", + " 'E C I H A*L D O H H H M I E U*B A R*S*F E S O A D*H Y*O ',\n", + " 'T*U E A O T*H E Y E I T B-W A Y E*F E N I N.P E*B H W D ',\n", + " 'U*A E M H M C E S M*A*C W P L O L A T I A I*D I T E*A W*',\n", + " 'T P A*T D A M N I N D*S O U*T P E I T B-W A Y E*A T*E O ',\n", + " 'S U O E O T.N I*T S E*G E O I T O U E,I T*N R A W W U*P ',\n", + " 'E*W D E O E I Y E M*W O I S P*T S E*D I Y R E H T*O E L ',\n", + " 'M A O T Y*N G O O R A F D E;A T*F N U D U*C N D U*T S E*',\n", + " 'W N H T*L A C G A A U I R N I F*U A T E I A I R*H M*I T*',\n", + " 'N R A W W U*W O U R*H A T A*E S E U Y*S O I D H.']" + ] + }, + "execution_count": 129, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chunks(repunctuate(combine_every_nth(split_plain), repack(ptb)), 56)" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[((25, 9, True), -1226.7606628204894),\n", + " ((11, 7, True), -1260.344065012207),\n", + " ((25, 17, True), -1285.2666386878766),\n", + " ((25, 19, True), -1233.0406991946986),\n", + " ((23, 2, True), -1286.699132753805),\n", + " ((1, 21, True), -1248.1083921858865),\n", + " ((1, 17, True), -1242.3820605977833)]" + ] + }, + "execution_count": 84, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "split_keys_affine = [affine_break(s) for s in splits]\n", + "split_keys_affine" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['osecdaebtyosaovcaaicolloayleryzcaocochkrndelsocceeaelaanveyecnldtcshtvcnlkscvcanechasyvhdynctkddntnlzmhccnohksnasncenaatleynhcahnyzndmayengdgosncconssocsmooclsccnecocolelinncyyicnynclsdsdbeeuctsjulcugscmnssesweonscclaceaysceoeleoccoyynlolznahruobvdmkoctnoavsegmhaanecclemyeeeedcsyyscnaetchccsecasrseuasllnyyannynelydytccseeancdegbigsvoccylilnnfstonocvccicyaccumgzzunaoncvcncetesydbravdeochkolnacahsuhlymnhycbyeencnksmlichhlinvrivhllchmmdrchnctlsnyyfcycyesrtwngnnhcahluycahlvvzndlcthlgazcyaoeseryvzlcnuoonckljcwnomunklulsdeuecczcadclnveynlyechoddvebeoesavrlhulsfbyvnvyeddorbzssanecscoocnhnynoyedvcoaddnvytvlyhcnbscvnlkacnnnacesbzcsblcyaeoclhnjuoadyidnyeunmchfvuclctblailaenakndmnennndgdnenlncdnoecaeseclvycolyysonydaohnmtyentenhodrohkeeycanlshidaiymjssofeydncooockehhcltwekybizotshsysckniacesgyaytcsyccaacfvtikenneeceavonwugclmlhhdtsafmdetbyansarnlvcetoncyatcvsnanyossackzhmeybursyaecs',\n", + " 'tednehneyqtfstcgwueutlnxmqshtntnawllfttymyelhnmmhlhlbumuhutlwmsalnhtuymaktfnimtaeeteqmmetemfxttmwuunnlthlcnuutyuucqeukwhweihuyebaqaamlyycqhxtkeabdttuhhwgithdlfelclcnnhlexmaeynqmwuhyenpleruflxtdeytbluufehwtqeehetyflfhherunafbtixftihunetnmltaettttaymntmtyhtyiaemuteehlmywenhwgiiyfenipuugiumtfnseqlptiluyynsanilbaqanswyndlshllxajtlaufmeiylupbunuaiezhificwhdewtletnmyatuypumcfehlygmwxltetretbetxsumktmextthluunwupgeyfytenxlnttlwaflwtuznaulkxxeualeqelwetstupemldhuwtmthtmbylttuimyyaulgxufmhthhhbxuimnrunfttmmtbtgenyhtegitgtspiimiihthayefeywttgywnudlyupunnipmtmnttehtlftauyfxwutemfhfuidpntyaluynagncyftfumtathhintulaxkbmtntenqeugfdtkdlhkliwtpthmtygytuygayaqbgypmmttyahbwcbfewklewuarnalymaynrunaiakiuwhltidulimyetlpbpuaqeerkmluedednytrmhettllqdeestwmrtuhhgdpfmehryeywyeuhyuhnamqtfmmlrtmmeyfttxuehltmhxnuweydembwxtuetfaklwwxutmepttagebmmamthtgxnwusmlftyalfbhsuiqqklnufkmkqieeagtetlueyylpmainf',\n", + " 'wbasetoblhjtnisnnnbfshsjyeseysyjtbhhstsuezetjeumtinytmjhnygirmsehotrmgmhtehsefshhtuieeshylksjetunwjmhseszmzaoagkteheqhnjreagmgthhhfhshwykhrzuubttiwjjtnntttshuhlztajehrfefgnhystasmhssjsrntunjmxregysemshnlnohenbbafshgstshoaeeeysfkaimzshmsuomhtoytjeiyouaxjgiyhekmsuimhikgremechdlymhfmryyhesusnsnhnhsunhmlssehfmhhhhhrreusimnhisftenjejhmnygmyhzyejhenretltnurhbhahbsrmystqgtnjfmbbjhwyeznubnmelehyzeqathqbjymbhnmfsyhhmbksanoyehihoneynnomrmnjyemybqhfbhzebbhemyhtaninqnayzthqhmhtsmeyztssstumkmhaseetmzeystnssjoyommohhhgefzniohslltojlewkshqbebzsmywyesyrtyyhzstzmktusnnetynhonkywahyubukjeyarkshutezhfhnsbubyhfymhszzbbyfyhabtsutynhhayusalnigstsisyhumjmbauznqahuhhnaubmsjtzthnanhhbrbubaotmeejrctztnnthntthabrhmeaaiefybyobhtmhhebhhkoshabhnnysamhtlsahttbsshygoyumtiotaesmbezbrejolmmseyhuhbjneuzybyyyrysbbjsmmwfysbyhbjtnstunyehnssnmohmnnygtsszsoeasbleztahyunesmesttmnnhhhhhojtnyhhebenuobmealumnzanahm',\n", + " 'ieaedtaelhirkemkutetlsmrjrmajefqjalcikmrtuifitfhnitetirnfnniknmdflnnsrnnknsabeosnkuzfteerlwirwtkdwljjmtnlbeeaeswgttrakdluieknrgtlrajeienekfeeaeratkilttkkksieetelteiteflimenkcmrfanjmeemacnncmrarkjrminmvrmtinigielkmrkifnoeinlwimmelncamjleqnrmgajtinugmniroknlftwkeunefnnluiotxkimrikjbnnrkrarmtokwwwiatlnekmwujiftltwutljluikfnubrncmwatxlouirtowtoenclttlrseuferdllmnbrmtarttwoeelmneqleuaeciiajerirantueamerlwtbfartkelwmicejtllvannistlweaomawejeekkikaemetfirtlqjgseuqfntuelrwbrirjlwmniwaswcjqltltrsnnmttmiraeemrejtrltaikrejmimnaqleawljeinelairigtnrkfrbtsaremwnrkoclteuxbnenllnbaealknbaaemenjfnthuhmajlkjtrnnqellajmunhatetwrickewiiahknoekomifjelmelieeteikjlrkeqcihikedtdlkfniualeeerertmtedenstnebrnlratjsnlglraheinenoelrdejkieaseafrwembojkeaqawremetjiiboatnauxinelkratureenianjoetarotfebelartlnllmhgrslnaelwlrqtenerrtckmloeeunrdredaieridwhiirewljeqqrnennwaakjltqhfllrrjtleeuoeoerrliurulaoau',\n", + " 'idpudfrpitatqpthadupiwdmotdrdjdhwsudovdvpdrhrlgdmupfouttwomuidddwhhdwgdgvodrdrcidqomhhdrmptvpjfqdwvdhdhwkwrcrajdthhphddrdrzwhgjhigsdruithqgrdhufrotahfofhhcgrpvdkfprlfgrrwndptddwwmhdiidhehhhtgpodwpoftrudohmhrjnnhdomwrghcrrthqhqgdhmmrdpraiphojrdpidddwduoawcjhhodfouviwdrdrildpmtoaddtptwpqpgioihqmogwfjtvddjtduihiwdewjptdudifddhhhtdotrpadudvrwcjpggipfptdhoocgdnhtmwgdfhgtnwovrftrowjrhwpecrrdrtmphwfpepodopwuiwwdvpdsodchijhhihrhvhdvrdprptujhioumwprrpoietudvrpmjdpcfddfperdqdtntfhpdmuordowjwelroidhtdpodchhoidwsopnlhwihwsrwitpcgqfwoerififhsutpqlngdtihfwrtdddhhwhrhfutrddigiiphweojtihojhdatihdltodtpnsdotpomwhqsapldbovtfovtmtqvtadpobmlomrtiwovcodsidspiadpiddhhwrtatrdhdptohpdvhiorehphtfndbedpthqrrigsvhddvirthgiiwiehfigtqndsipihpwgwhdicevivorbddddhevrhcopwpworedsdgsfdwosmirnnrfvltclwodiirnuhdhftwqowimwirthtghfhvgpltjtjjvieagdoddwirgndtwmmprqpovfdpffigpruowphdwwchdgohhpadjppgpqemhvthujrq',\n", + " 'sacboagcisnxxxamhextyraritqeoldcmtsracrxroahishlnllblhvsofnstsddnhxxaxsdcoosoifhisjtxchsrtaxudsxrnsaxrtbtvsrgtdelcsdhersoahndthxixtldhdscbesvstxdsvnhplahctddptotigisbdhsoxldlprlorcraornlcccvdsofibshoxhlsdrhadsdtysrnnuxrientmmstohilduseptuceheooenobmvsotntihsiidjhrtsoyohpfpxrihtasvxgcxdidhetusnshexaodlnhascusioatbrnonshttoactcvxltxnfnslthoddsntsiydvopfuxtadaodhxodhtatarrdxvxrbesceiltashatrdhghstdaeftixxloltsntiencgdccerdxxfrteesstoytcxruoutnhmestdsltehidrolhelcstdoboooihhmspsigriidohrgohrtxfroorctoxactohxtcotdctteklhldaxoiltsauhhhpdhpdhtdtxcdrsxsmdhxlithshoxxedtsaeceuokaucoemspbttldsjrarxtgabuofbcmtbhxohycphsxxrslxvhacyhfteodahunkponttwtxsdrdilitcraltosixdaoartocttrilumcvtcfolrdeyxdxuttxciekheidhttbitcfitamhotdqxccntbmlxpyctuisdaoooulusxsohmioodlntettsxrstiauxtittcvmuerltxttxttsxvrsgrnrotethxdrdhstlsreaxexddttrolootetddsrloesaaottedhxtxxihpbsydunuhxxoytsthethhtdllcxathesc',\n", + " 'oicttiolkktdbdhlfrhsiiitifbtiwvtlkthiwtdtnuotkqactthmiwlihckdfhdcoihlffnwwntsmmqhotthtvkmfkdhdobilwwuihkftpoldbtwtkstwtniifivtfukbdwiiicltofttphhblbothwstlqsorkfkhtkodfkauththoawclaswttlttttqttobhefvwaawwwvwskfnlkdrlfittocuttkklqssadlsosvltftiooeiottkidvhookzhfthtiksnifhaiddkdwilwckwddaiqqbdktwfwdovdmidflwwoktfhutltrkvieiitdttuanpltrkasinhhltltolhtfhafacphovadblstolhtntcptiouoftlllhvkvtffsthiotfiiaslhpaoaekfazttthrriilhubtaliiwkpiojtqshndvtfkkodhkanlftslotfiqtosaihiveleswlektiwzbhnabtnlwjdltntothibtlatqhdtrwdlapfwtsonhdlzwpcieesioaiaviwbfatoitdwlidsiovooifputikwbbtoalltetswtktkfnuvkofptbrllwsnikotphdqiawkbdwddrlwftfilodiwouiqthoahnftnihunstikaofohiaslpkhdwftonidwwttlewtthltollftcucidlpqtwwcrelialskhwomklioiocdbrllthiooboiweaikdlnwihlfhnhtowovdalfhullkuwkhssthkoqoatodtswvbiahackptzktithwvpqidqwidattofpudsdrhdbdnporsifhdfznnoftwnfflffuebhattlfuhacroubnulwlirhdvsqtntcwhiuol']" + ] + }, + "execution_count": 86, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a_splits = [affine_decipher(c, m, a, o) for (c, ((m, a, o), _)) in zip(splits, split_keys_affine)]\n", + "a_splits" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "OTWIIS OS EBE DAIEDAAPCCCNS, EUBTDEEDDOTAH TTF AIENOARG OB EBE PCLTYL LIIKYQH; HTSK OTJIANTSFTRTXDA.\n", + "SNK QXBO TIEP XDVC. SMTA HCGNKH MLA WNUAHFAUNTDE RI EBE UXHCUFT PTSOTSLIY IL LHSWRI LN SMD\n", + "AIOXJRMRTA MYJ OIIYQERTTF LS SMD QBEHE-ARETRTYJDOI YNSEJLWZTYFD DVCNJQ, HCT AATJWM LOWBAST,\n", + "KCLHLUSTO LHCDRHCF SI OA IHT TKVCWKT. SMD RTRYUR VXDNMETP RTDYZUDONEEEIRA ULL TFHHOSH JIRITONETL SKC\n", + "MUFGHQC, MM HDLA EH T NMNCELI IU LTAHNTP LTELYEF BHLB TTOLMAUM IU HIA MJRTVWNUHN. TS LVHN FWOIEUYN O\n", + "FHYTG NMNCELI IU SKC WRKITDN MMNDSF LS SMD DHDAEDD DDT LHFWNCCNOLHHOSH TN HX IHT RND XH TUMSWALV YG\n", + "RGXFC MMNDSF. NAH NGDNLK TKVCWKT EN OO WSFHSDONCNS ARSTVIEBDOSC MFERIM ATS OC FM NAH SIHQEEH\n", + "NDIHCETKQ SO HTU UOJTAEI ZMTTS QEFHXHYM ET HCT VMSE DHVHEHERSK DTYRMRM. YE LLP TFNMKWTAKCF SI\n", + "VXDTXJR PUHKTEWJDDDT TTF SO DMUKQ XBN WNDDRI TUWWWNLNUJ LVSWLNM JDAWZNHJ HX UMLSMDR IHT ETHTHCHSN WB\n", + "KCL ZLKTFNC’M BWVTONZERS, PHUAE CROKUOARG LS TAEATDN YG SJDBAUKWD ETSUTGTLWNC ET HCT CQHTH SKEE ERP\n", + "DSNUQAHHTA KHKD EWAWNDDRTT. HJLRS NLWRUDOIEEEIR AIYIA EZHFNH GKWN IHUM NHDVC YG RGT TAETGJHFHBHTH XU\n", + "NAH LIIKYQH, RGXBZA FASTD NAH JDLWDMSE RDIMLH IU HIA YWEIDIYYYN, TS CEC KE HCLN QHKQ BTG HRFG\n", + "EODXZERSF GTUE DVTO KUAHSTS. EBE UTP NATR FX HCBTAR DHC DI TOSBOT WKTVLNT JIANBSUJLHHOSH TTF\n", + "PTOHNTOL HCWNKFA. WS GTKHHSMITK HCTOT TSCTLOH SI GDQC DHER D SLLUEPPOSFHTVT RCELEDO KCL ZLKTFNC TTF\n", + "IKELAEP GHCC JIRITONETL SKC NHEF BOO HRFG DD LLFLRHFEEEIR, SKLXFM WOAI M GEN XU NANND LTNEHKP DHC YY\n", + "CTLT YN SMD PHYQTRD ROIMA FWLACWSAWO. WN UM NMRCYHHJ HCLN YSMDR ACESEIA SLNJEIOWSP SMD RTDLRAHNTSE\n", + "NC ELLDR TN HCT BUUNH CTEF NC HCT ELJMTVT UXMR GDQC TXAPSTT, DRR OO TSEEKD FOJ YG JWIBUTYRP BHLB\n", + "SMOS ECLEIF HF UUMNTOV GUSM RX WSFHV UHAC EN RDLA MH LMOS WN WNTHDWSTO. IMR WSQHNHHVEEEIRA WSEN\n", + "GJDSW HBIN SKEE BE NDF OTALHTN NY FKDY, LSF SMOS KC LHRMRDCF GKWN RLHSIR NLAHTFGUFCESN HX IERH OC\n", + "RTAUOERIT YN AIREOS. AEN TNCCFELHT UEBEWQ MTOT YIH MTEISMQ, SKLXFM GT KEF KEDO L OTALHHQCII\n", + "NMISCHMCML SOUZARDA YN SMD UDYEHJ PSLNTM, LRE SLNSEAPOOMUQ ITSLLON PUVZTMR HCLN AH MOE TAETGJHFHTO\n", + "ARETRTYJDOI UTTTP. OO OTJIIE OB AEN DNEVYIUDOI DMY GD BOMNO, MWMTKTU NDVTOMA IU SKC TXROOI TYJOATDNH\n", + "GKWN VOTI’N CTHAYYLJ IOVIHFHHOS AETH SKEE KWOIZ GMM KDIHMUSEF DF HTU UOJTAEI’N UHHAE MEVRTN\n", + "HHFITIELI, NW SKC MKNDOSC YG LRY NLWRUDOIEEEIR HF MNMOIPHYHETL. FAEWC XDPI E GHKPXDEI DIMRDEI LMTIK\n", + "DYYROHDCF MIAT WSEHKDAIYNF JDSLYIM, BTVWSP RN PXCC UYNTGKN UYRW CWA GHKPXDEIERQ, DDT US AP IACMU\n", + "RGDI HT SMIHQCF NT OEQCNSOIT. BSSNKHUDEEHWQ, SKC QNWMNTA LHWOSWSP SI GHF RTUAWE WS INTFXD ELH LJAO\n", + "UUMNTOV, AY LE VDDSYS KDLM LN SMDN IL SEWJ HD NAH UTAFYNF JDSLYIM IU CWA LHFIUWNBHTH SO NAH LIIKYQH.\n", + "TWOTNAHWDAF E NRUETH LS RTWBUYWELJ RTDYUJP NLYNSLTOTT DI UDNRCLM IU SKC SNKDHVS HHFITIELI’N\n", + "FTEELSUDOI AXFBDAI NATR HCT CJENHTDDT NC HCT ELJMTVT, GAEWD XUBUJAOLAI FHTTTN, GMM XRXPS EN L PNLVI\n", + "YOAFTO YG UDNRCLM IU SKC UYRDLAYPHTVT SLBZORHII UY WWONLN. ET CDHNUJOJDH NAH EPSLFIENGNTSE NC\n", + "GTLTZRLISTOH ET PIONITTF YLOF LLP D HCITRTVTVC NSDO FCWUEH, PHCHRUOFAI DHFOUFC EBE CXAYWH RGTCATADDA\n", + "PCLH LNDHC EBLH AOUTSMTOV MNRNMDA GMM BWHDZ YY, RGXBZA SMD OLUT TTF DSNUQAHHTA YG RGT OOPTTTALNUNT\n", + "NTHC M JWWATVC FOORNCF MEVRTN. EBE RDCC HBLFXP ELJMTVT TYHN RXI EGWEOR OS MYQ WBUYWELJ EODXZERSF\n", + "BLNU HCT RTUAWE. LA EBE PILVT NC ELLDR’M ICTHEEEIRA VOTL AR SKC BEJ DHVHEHER ATKTYRTTF, OXZIMRF LS\n", + "ERP DSNUQAHHTA MANW GHCK TTF HI ATHUP SO HMQE ETTS EBAP, DF UXJM OA IHT YEDE IL TMROFAYHB L PTSMLH\n", + "WWILNUNT UXH HUM BIXPYNF FWLACWSAWO OB UYRDLAYPHTVT EEGHKP, SKEE MEDNF NY BLST ACF KWOIZ NY SMD\n", + "ETKTAICNTSE NC HCT MNOEIGHLXYJ JDRILETHC RCNHLHC IHT ILIE. IHT HVHRLLLOARDHI WNNH XU NAEN VXBVF YIH\n", + "FT RLNSDRAI WNTVTLVTO LRE IHUM WDE IL ZREPSWLNM AR SKC ANOPT PHUJM TO IMLY, AU YOM KEWJ TJDXME HCT\n", + "RXY, JIXQC EBE ORSHUQE UUHNAHK MONCLFKWUDT. EBIPT VLQHKRNTSE ZARHFNLEEP MKYWB MOE KYEBEISO FTHT\n", + "ETDCSEFTDHYTM IU SKC UYRDLAYPHTVT NEET LRE LSMAQPHF RLNJMITT DI GJDSW’H NSDRLNUQEP OOG WNUCLTNTAQ\n", + "FHFNMYFDE IHTZNDLQCH, TTF CT ATHUP SO HMQE ETSLBH LR DAUYMR DOIYLHWQ BHCT TBDOI, ATSRTOV HUM INO\n", + "ELIERTILV MYJ FHEVYZLHHS ZYTWP MWNA SMD SLDUS NMPELLS IU SKC GTWOIT. TXUARG IHUM SDRWLF, KWOIZ GMM\n", + "CWIBAHHJ JDHZTAQ WO NCHSLEHAYHETL RBAHELR, GTOBTT OON EXMRIHLS UZSDRWEIENH TJRMYNTXD YN SMD FLVRTTP\n", + "RTZUNT, OON LN SMD OTCF SI CRONTJR HCT UTOAHTHOMYEOO IOMOE IXBNTM. MD ATCBM RW CLKT OESTALGHJ OO\n", + "TJEHTPHQC NHRNXHW YG LLTDNH ET HCT OTFAWO, RME ZIIT WUGNKHDDNII RW CLKT OESTALGHJ RTP UTSMWEF LS\n", + "LIIKWSP. LMTLT DITNPHSEI OACLOUMJQ GDN EILLQA HCIEEF XD CHWAWOLZT, KWOIZ CHSLELWAAHJ RTP DYQEIS\n", + "CCEBIFA IL FENIUEN EBE FHEVYZLHHS EWSASHIYTM IU PONTYRTDA LGWIPHIYYY, GQ PAEWETL DVCNSN NHIHUY RGTWO\n", + "DRKDDBDLTFTTF. DYYRIXAVUYB HCT EPHTFD OB UZSWRIENS ARSTONTRTXDEI ZEDSWSPM, MD MLA MKWD, DI VTTNH HD\n", + "RMUR, HX SLNSKWL IHT NOHIOUT NC RTVLEELHHOSH, TTF SO FTYEUHI BLNU TOFYFH XRXPVTOBD XU NANND\n", + "ETVUKEIDIYYYN. GT KEF WLISWDXALI ABDWHNP EBOUYB HCT RTUAWE OB EBE EUAZMUAOO LSF KLJKLSH JKTATA\n", + "FENIUENUYB HCT EIAAOOSC DRAJEWSP KEHMTCN SMD SKOTH EAPTOYUN. TB KC ATJ ITFNLEFHTN HUZNDLU NY\n", + "HTLDVYNF HTSK NAH UOJOO GNHDRF YN SMTA PEC BAP RTDYUJ NXBVF BLST RCTY KDGLOFHJ OA L AUFTTBWDMYR\n", + "PUSDTMN OON NAH NMFIVTSQ WB KYH ZEHCOTH ZLQ MTVI BLST PLN BAA BHYTYJP HD HUFM LXQCLYUDOI. NAH\n", + "NBHABXA HOY WS KBAVC KC BTTTPBVMSEF HDNTUTOSWLNTW VXDKTYRTXDA EN IMR RCNHCTS LN QHKQ LWNEAE VXFN UY\n", + "WTVTA GUIAHFCF SI DAIEDAAPC L STL HOY OB KNKBHDZ DI NMFICLGOLT WSHSEOE OB KTK. MOULLSORDICII MTA\n", + "QYWSIIHTA TYFWUHEPHJ O NOOT UEVKACHM LCPHLMJM OON HT MEDNF NY BLST TJGAIITN UYUE DWIOTZE STHAUNTP XU\n", + "DYQEIS NYGAIADSI. AHKD RTDYUJP DI NAH LIIKYQH RDLA E BNKD IOUGAEHT FNYUQ, HCOMPB CWR HCMMIRA IHMS\n", + "HTLA FTJIAT SVTTK TO L UYZERS, PC ATDD IKLHHT HX HCBNDD DDT WALPAWBC, NK TO FLBH FOATA FHNHROI,\n", + "EBIPT NLWRUDOIA KBAVC DELULHT WN. EBEIT WA WAEOR TKUOERIT NATR ELLDR MEH UE MNERP MWNAET HCT ELJMTVT\n", + "NY RTFTHNMCE NCLN ATDD FTDYZE BOOGN TN ELLDR NSDRLNUNTP. (DF EN TNTET, NAH EHYCLINBQ XU NATR RDCC\n", + "KTN RXI DIHLI UDNUA RGT LOWBAST PEH RTVXQCLHJ.) HCTAT MSDIWEIENDE WS DALVKCEUA, GIHRCLI LRE\n", + "ELIERTILV MFAHDIYYY. HGHAC EBEIT LOT YI ITSLLON WB KYPBEI IHYBHN ETWSP TOHCOOUMEF FM NAH LIIKYQH,\n", + "RGT LDEEDTAIA EBEQ MOORHJ NHIH KHKD OON MKIST CMLOEI, DDT US AP QBYEH SIXREDAE HCLN EBAP CLT DHFWNT\n", + "ENNRGTH NYNW WB IHT YEHMOOR. SMD LODMA BIXBRH MOCPOOEHJ EY IHT TKVCWKT LEIT EELSAVUAELAQ OIIYQH AR\n", + "SKC DTWBDD AETRDA LN EBE DON LS SMD OWSTSEDOIH WHTHUHI, MYJ ELLDR GIVUFATO IR SHIUYB HX NYHUOCS\n", + "HMHMAOO TJGTTPHOS DI NWMWSP OAPIOOF TUWOV FMAXOO DEEEIRDAYHSN. ELLDR MEDNF NY BLST HCEEKDE UOYZ RGT\n", + "LOWBAST LOYRTF SKC EEUD XU KUJRWRWE’H OEOSK, HYLESTH HUM NMISCHMIIA SLNSARUTT AEN NXHW MYJ NT KEQH\n", + "ORIOKTUEF TQYFHTVT OB M BALCAI MJRTVT ZLNOC MOORETL UDTTU FWET SMZE ORSHMYBDL WS EBE ITVYYY LIXBSF\n", + "YARTICTY RNTAKT. RTUXHNXYLHTAI, US NDTCA EBLH SKC HBLFXP ELJMTVT STSHWRZ GMM GQ SKYH MROGT\n", + "AXWSWRIYNF LINTT UYNMRHCWSAWO WS EBE ITVYYY, LRE PC DHWTTQC EBLH HIA MJRTXDA BTQ GDQC WNTHRWFXSEF,\n", + "DI VTTNH HDTUUEVSAI, EN RGT TKTYRP LTEFETL SO NAH CTRFN KNKJE PEL. SMTA UEWS LJXDC WNOJE SEXME\n", + "VXDAUOEIDRVT HUEDHOMMNATDN EN RGT BW PNDDRDUTYR OON GT GEDL PC ATDD OO LGSAWO RME SI ITSLBZERE IHMS\n", + "RGT FHMOIN DHDAEDD DDT MAW TSF STSHWRZA HBIMLN FT LIMON MG, ERP EODXZERSF ENTWQATT, WALPAWBUHJ, OON,\n", + "YS YEVTFAMUQ, FTFNLNQDE, LSF ERP DFATSN FHFRYMEF XU. NAEN ITELLS NGXBVF TWPX HCBTAR IAEHMAUHTT SNK O\n", + "PTOUNJ WB LN IHLPS FCQHTHY-UYQH QDDHA. KH HWUAT LHFWNCCNO L CURVUJLHHOS FTRD XU NKN RGXBAMYJ OON\n", + "NKHTHY-UYQH LH TLOIEEPS. WS EBE ATLSEEUD, HI AANOJE RC GUEPTHKTO OPHDZ EBE GHVHTMR PTSMLERQ\n", + "DQEUALELT; YE LIMLN BYUU HCT UYMR VXCRLNUTAWSP ZLHTHYMA AU HI AANOJE UEIA ARSO CNHUQ CLSFM.\n" + ] + } + ], + "source": [ + "print(lcat(tpack(repunctuate(combine_every_nth(a_splits), ptb).split())))" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": {}, + "outputs": [], + "source": [ + "def split_decipher(split_message, pt_alpha, ct_alphas):\n", + " split_maps = [{c: p for (c, p) in zip(pt_alpha, cta)} for cta in ct_alphas]\n", + " split_trans = [''.maketrans(sm) for sm in split_maps]\n", + " split_plain = [s.translate(st) for (s, st) in zip(splits, split_trans)]\n", + " return combine_every_nth(split_plain)" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "metadata": {}, + "outputs": [], + "source": [ + "def split_swap(ct_alphas):\n", + " k = random.randrange(len(ct_alphas))\n", + " i = random.randrange(26)\n", + " j = gaussian_swap_index(i)\n", + " swapped_key = ct_alphas[k]\n", + " if i > j:\n", + " i, j = j, i\n", + " if i != j:\n", + " swapped_key = (swapped_key[:i] + swapped_key[j] + swapped_key[i+1:j] + swapped_key[i] +\n", + " swapped_key[j+1:])\n", + " return ct_alphas[:k] + [swapped_key] + ct_alphas[k+1:]" + ] + }, + { + "cell_type": "code", + "execution_count": 115, + "metadata": {}, + "outputs": [], + "source": [ + "def split_sa_worker(message, plain_alphabet, cipher_alphabets, \n", + " t0, max_iterations, fitness,\n", + " logID):\n", + " temperature = t0\n", + "\n", + " dt = t0 / (0.9 * max_iterations)\n", + " \n", + " current_key = cipher_alphabets\n", + " key = current_key\n", + " plaintext = split_decipher(message, plain_alphabet, key)\n", + " current_fitness = fitness(plaintext)\n", + "\n", + " best_key = current_key\n", + " best_fitness = current_fitness\n", + " best_plaintext = plaintext\n", + " \n", + " # print('starting for', max_iterations)\n", + " for i in range(max_iterations):\n", + " key = split_swap(current_key)\n", + " plaintext = split_decipher(message, plain_alphabet, key)\n", + " new_fitness = fitness(plaintext)\n", + " try:\n", + " sa_chance = math.exp((new_fitness - current_fitness) / temperature)\n", + " except (OverflowError, ZeroDivisionError):\n", + " # print('exception triggered: new_fit {}, current_fit {}, temp {}'.format(new_fitness, current_fitness, temperature))\n", + " sa_chance = 0\n", + " if (new_fitness > current_fitness or random.random() < sa_chance):\n", + " # logger.debug('Simulated annealing: iteration {}, temperature {}, '\n", + " # 'current alphabet {}, current_fitness {}, '\n", + " # 'best_plaintext {}'.format(i, temperature, current_alphabet, \n", + " # current_fitness, best_plaintext[:50]))\n", + "\n", + " # logger.debug('new_fit {}, current_fit {}, temp {}, sa_chance {}'.format(new_fitness, current_fitness, temperature, sa_chance))\n", + " current_fitness = new_fitness\n", + " current_key = key\n", + " \n", + " if current_fitness > best_fitness:\n", + " best_key = current_key\n", + " best_fitness = current_fitness\n", + " best_plaintext = plaintext\n", + " if i % 500 == 0:\n", + " logger.debug('Simulated annealing worker {}: iteration {}, temperature {}, '\n", + " 'current c alphas {}, plain alphabet {}, current_fitness {}, '\n", + " 'best_plaintext {}'.format(logID, i, temperature, current_key, plain_alphabet,\n", + " current_fitness, plaintext[:50]))\n", + " temperature = max(temperature - dt, 0.001)\n", + "\n", + " return best_key, best_fitness # current_alphabet, current_fitness" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": {}, + "outputs": [], + "source": [ + "def split_sa(message, plain_alphabet, cipher_alphabets,\n", + " workers=10, \n", + " initial_temperature=200,\n", + " max_iterations=20000,\n", + " fitness=Ptrigrams, chunksize=1):\n", + " worker_args = []\n", + " ciphertext = sanitise(message)\n", + " for i in range(workers):\n", + " worker_args.append((ciphertext, plain_alphabet, cipher_alphabets, \n", + " initial_temperature, max_iterations, fitness,\n", + " i))\n", + "# print(worker_args)\n", + " with multiprocessing.Pool(10) as pool:\n", + " breaks = pool.starmap(split_sa_worker,\n", + " worker_args, chunksize)\n", + " return max(breaks, key=lambda k: k[1])" + ] + }, + { + "cell_type": "code", + "execution_count": 126, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['fudjphwtaemovnxgzqibclysrk',\n", + " 'sjditvqeruzbkflcayxhwngmop',\n", + " 'ixlcwrdopvgqbyhkejftzsnmau',\n", + " 'naegyjrfhivxmdzqbpokluwstc',\n", + " 'pdfztakijgnoqxcsmywlrvubeh',\n", + " 'onjscymxvgdzipwhkqatbfelru',\n", + " 'kzcfynwubrjeslmtghivdqaopx']" + ] + }, + "execution_count": 126, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pt_alpha = cat(l[0] for l in english_counts.most_common())\n", + "split_counts = [collections.Counter(s) for s in splits]\n", + "split_alphas = [cat(deduplicate(cat(c[0] for c in sc.most_common())\n", + " + pt_alpha))\n", + " for sc in split_counts]\n", + "split_alphas" + ] + }, + { + "cell_type": "code", + "execution_count": 127, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "100000000" + ] + }, + "execution_count": 127, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "10**8" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2000000" + ] + }, + "execution_count": 136, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int(2e6)" + ] + }, + { + "cell_type": "code", + "execution_count": 137, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(['crdhgmszjaktloxbefnwuqvipy',\n", + " 'najgryfehivdxkbmpqzlouwtsc',\n", + " 'wphqekyxnsizjauobcldrgtfmv',\n", + " 'szvtderqiubkcxnjhafylwmogp',\n", + " 'jiuracqpgtwzbvmyshexkoldfn',\n", + " 'zyebmtwoxcqjrfaiklugsphnvd',\n", + " 'dmzxbivulyfngsraowjhpeqckt'],\n", + " -20379.803672616308)" + ] + }, + "execution_count": 137, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_b, score = split_sa(scb, pt_alpha, split_alphas, max_iterations=int(2e6), workers=20)\n", + "key_b, score" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "REPORT ON THE ESTABLISHMENT, EFFECTIVENESS AND STANDING OF THE SHADOW ARCHIVE; WITH RECOMMENDATIONS. FOR YOUR EYES ONLY.\n", + "THIS REPORT WAS COMMISSIONED BY THE FOREIGN SECRETARY TO REPORT ON THE STRUCTURES AND ACTIVITIES OF THE QUASI-INDEPENDENT INTELLIGENCE AGENCY, THE SHADOW ARCHIVE, HEREAFTER REFERRED TO AS THE ARCHIVE. THE REPORT CONTAINS RECOMMENDATIONS FOR ACTIONS CONCERNING THE ARCHIVE, AS WELL AS A SUMMARY OF LESSONS LEARNED FROM ANALYSIS OF ITS ACTIVITIES. IT ALSO CONTAINS A BRIEF SUMMARY OF THE CURRENT ASSETS OF THE ARCHIVE AND RECOMMENDATIONS AS TO THE USE OR DISPOSAL OF THOSE ASSETS.\n", + "THE SHADOW ARCHIVE IS AN INDEPENDENT INTELLIGENCE AGENCY SET UP BY THE PRIVATE SECRETARY TO HER MAZESTY QUEEN VICTORIA IN THE LATE EIGHTEENTH CENTURY. IT WAS ESTABLISHED TO CONDUCT SURVEILLANCE AND TO CARRY OUT COVERT DIPLOMATIC ACTIONS DESIGNED TO FURTHER THE INTERESTS OF HER MAZESTY’S GOVERNMENT, WHILE PROVIDING AN ELEMENT OF PLAUSIBLE DENIABILITY IN THE EVENT THAT ITS ACTIVITIES WERE DISCOVERED. SCANT DOCUMENTATION STILL EXISTS FROM THIS STAGE OF THE ESTABLISHMENT OF THE ARCHIVE, THOUGH GIVEN THE DELICATE NATURE OF ITS OPERATIONS, IT MAY BE THAT VERY FEW SUCH DOCUMENTS WERE EVER WRITTEN. THE FEW THAT DO REMAIN ARE BY NATURE PRIVATE COMMUNICATIONS AND PERSONAL RECORDS.\n", + "IN PARTICULAR THERE APPEARS TO HAVE BEEN A CORRESPONDENCE BETWEEN HER MAZESTY AND CHARLES GREY CONCERNING THE NEED FOR SUCH AN ORGANISATION, THOUGH ONLY A FEW OF THOSE LETTERS ARE ON FILE IN THE PRIVATE ROYAL COLLECTION. IT IS SURMISED THAT OTHER LETTERS CONCERNING THE RECRUITMENT OF BLACK AS THE FIRST HEAD OF THE ARCHIVE MUST HAVE EXISTED, BUT AN ENTIRE BOX OF DOCUMENTS FROM THAT PERIOD IS MISSING WITH NO INDEX FILE TO TELL US WHAT IT CONTAINED. OUR INVESTIGATIONS INTO BLACK SHOW THAT HE WAS RELATED TO GREY, AND THAT HE RETURNED FROM BOSTON MASSACHUSETTS TO TAKE UP RESIDENCE IN LONDON. HIS IMMEDIATE FAMILY WERE NOT WEALTHY, THOUGH HE HAD BEEN A RELATIVELY SUCCESSFUL CRIMINAL IN THE UNITED STATES, AND CONTEMPORARY RECORDS SUGGEST THAT HE HAD ESTABLISHED INDEPENDENT MEANS. NO RECORD OF HIS EMPLOYMENT CAN BE FOUND, HOWEVER SEVERAL OF THE EXTANT DOCUMENTS FROM GREY’S PERSONAL COLLECTION HINT THAT BLACK WAS RECRUITED AS HER MAZESTY’S FIRST SECRET SECRETARY, SO THE ABSENCE OF ANY DOCUMENTATION IS UNSURPRISING. BLACK KEPT A PERSONAL JOURNAL WHICH CONTAINED SOME INTERESTING DETAILS, GIVING US SOME INSIGHT INTO HIS PERSONALITY, AND IT IS CLEAR THAT HE THRIVED ON ADVENTURE. UNFORTUNATELY, THE VOLUMES RELATING TO HIS PERIOD IN LONDON ARE ALSO MISSING, SO WE CANNOT RELY ON THEM TO FILL IN THE MISSING DETAILS OF HIS RECRUITMENT TO THE ARCHIVE. NONETHELESS A NUMBER OF UNOFFICIAL RECORDS MAINTAINED BY MEMBERS OF THE FOREIGN SECRETARY’S DEPARTMENT SUGGEST THAT THE EXISTENCE OF THE ARCHIVE, WHILE OFFICIALLY DENIED, WAS KNOWN TO A SMALL NUMBER OF MEMBERS OF THE INTELLIGENCE COMMUNITY IN LONDON. IN PARTICULAR THE ESTABLISHMENT OF HEADQUARTERS IN SCOTLAND YARD WAS A RELATIVELY OPEN SECRET, PRESUMABLY BECAUSE THE POLICE THEMSELVES WERE AWARE THAT SOMETHING UNUSUAL WAS GOING ON, THOUGH THE NAME AND ACTIVITIES OF THE ORGANISATION WERE A CLOSELY GUARDED SECRET. THE NAME SHADOW ARCHIVE DOES NOT APPEAR ON ANY OFFICIAL DOCUMENTS FROM THE PERIOD. AS THE SCALE OF BLACK’S OPERATIONS GREW IN THE MID EIGHTEEN SEVENTIES, RUMOURS OF ITS ACTIVITIES ALSO GREW AND IT SEEMS TO HAVE BEEN THIS, AS MUCH AS THE NEED TO ESTABLISH A SECURE LOCATION FOR HIS GROWING COLLECTION OF INTELLIGENCE PAPERS, THAT SEEMS TO HAVE LED BLACK TO THE DEVELOPMENT OF THE UNDERGROUND LABYRINTH BENEATH THE YARD. THE EXTRAORDINARY COST OF THIS COULD NOT BE PROPERLY CONCEALED AND THIS LED TO QUESTIONS IN THE HOUSE WHICH IN TURN, IF YOU WILL EXCUSE THE PUN, DROVE THE ARCHIVE FURTHER UNDERGROUND. THOSE GOVERNMENT MINISTRIES WHICH HAD HITHERTO BEEN BENEFICIARIES OF THE INTELLIGENCE DATA AND ANALYSIS PRODUCED BY BLACK’S OPERATIVES NOW COMPLETELY DISTANCED THEMSELVES, AND HE SEEMS TO HAVE BECOME AN ALMOST ENTIRELY FREE AGENT, SETTING HIS OWN POLITICAL AND DIPLOMATIC GOALS WITH THE TACIT SUPPORT OF THE PALACE. DURING THIS PERIOD, BLACK WAS FOCUSSED LARGELY ON DESTABILISING RUSSIAN, GERMAN AND AUSTRIAN IMPERIALIST EXPANSION IN THE BALKANS REGION, AND ON THE NEED TO PROTECT THE MEDITERRANEAN TRADE ROUTES. HE SEEMS TO HAVE DEVELOPED AN EXTENSIVE NETWORK OF AGENTS IN THE REGION, BUT MORE IMPORTANTLY TO HAVE DEVELOPED NEW METHODS OF WORKING. WHILE CLASSICAL DIPLOMACY HAD ALWAYS RELIED ON ESPIONAGE, BLACK ESTABLISHED NEW COVERT METHODS TO DISRUPT THE DIPLOMATIC ACTIVITIES OF POTENTIAL OPPOSITION, BY PLACING AGENTS WITHIN THEIR BUREAUCRACIES. CONTROLLING THE AGENDA OF IMPORTANT INTERNATIONAL MEETINGS, HE WAS ABLE, AT LEAST IN PART, TO CONTROL THE OUTCOME OF NEGOTIATIONS, AND TO BENEFIT FROM INSIDE KNOWLEDGE OF THOSE DELIBERATIONS. HE HAD PARTICULAR SUCCESS DURING THE PERIOD OF THE BULGARIAN AND BALKANS CRISES DISRUPTING THE ALLIANCE BUILDING BETWEEN THE THREE EMPERORS. IF HE HAD RESTRICTED HIMSELF TO ENGAGING WITH THE MAZOR POWERS IN THIS WAY HIS RECORD WOULD HAVE BEEN REGARDED AS A SIGNIFICANT SUCCESS AND THE SUBTLETY OF HIS METHODS MAY WELL HAVE WON HIM FRIENDS IN HIGH GOVERNMENT. THE SKILFUL WAY IN WHICH HE MANIPULATED INTERNATIONAL CONVENTIONS TO OUR BENEFIT AT VERY LITTLE COST IN LIVES PROMISED TO ESTABLISH A NEW WAY OF WORKING BY SUBTERFUGE INSTEAD OF WAR. UNFORTUNATELY HIS VICTORIES ENCOURAGED A MORE RECKLESS APPROACH AND HE SEEMS TO HAVE EXPLORED MORE EXTREME VERSIONS OF COVERT DIPLOMACY. HERE RECORDS AT THE ARCHIVE TELL A MORE COMPLETE STORY, THOUGH FOR REASONS THAT WILL BECOME CLEAR IN A MOMENT, WE HAVE CHOSEN TO REMOVE AND CLASSIFY, OR IN SOME CASES DESTROY, THOSE DOCUMENTS WHICH NARRATE IT. THERE IS CLEAR EVIDENCE THAT BLACK SET UP UNITS WITHIN THE ARCHIVE TO UNDERTAKE WHAT HAVE BECOME KNOWN AS BLACK OPERATIONS. (AS AN ASIDE, THE ETYMOLOGY OF THAT NAME WAS NOT CLEAR UNTIL THE ARCHIVE WAS UNCOVERED.) THESE SPECIALISED IN BLACKMAIL, BRIBERY AND POLITICAL AGITATION. WHILE THERE ARE NO RECORDS OF HIGHER CRIMES BEING AUTHORISED BY THE ARCHIVE, THE ACTIVISTS THEY WORKED WITH WERE NOT ABOVE MURDER, AND IT IS QUITE PROBABLE THAT THIS HAD BECOME ANOTHER TOOL OF THE NETWORK. THE LOCAL GROUPS SUPPORTED BY THE ARCHIVE WERE PARTICULARLY ACTIVE IN THE BALKAN STATES AT THE END OF THE NINETEENTH CENTURY, AND BLACK FOCUSSED ON TRYING TO DISRUPT RUSSIAN EXPANSION BY SOWING DISCORD AMONG BALKAN NATIONALISTS. BLACK SEEMS TO HAVE RETIRED FROM THE ARCHIVE AROUND THE TIME OF VICTORIA’S DEATH, HOWEVER HIS SUCCESSORS CONTINUED HIS WORK AND WE HAVE UNCOVERED EVIDENCE OF A HIGHLY ACTIVE GROUP WORKING UNDER CODE NAME ARCHANGEL IN THE REGION AROUND NINETEEN TWELVE. UNFORTUNATELY, IT SEEMS THAT THE SHADOW ARCHIVE NETWORK WAS BY THIS STAGE SUPPORTING ARMED INSURRECTION IN THE REGION, AND WE BELIEVE THAT ITS ACTIONS MAY HAVE CONTRIBUTED, AT LEAST INDIRECTLY, TO THE EVENTS LEADING TO THE FIRST WORLD WAR.\n", + "THIS FACT ALONE COULD CAUSE CONSIDERABLE EMBARRASSMENT TO THE UK GOVERNMENT AND WE FEEL WE HAVE NO OPTION BUT TO RECOMMEND THAT THE SHADOW ARCHIVE AND ALL ITS NETWORKS SHOULD BE WOUND UP, ITS DOCUMENTS ANALYSED, CLASSIFIED, AND, IF NECESSARY, DESTROYED, AND ITS ASSETS DISPOSED OF. THIS REPORT SHOULD ALSO REMAIN CLASSIFIED FOR A PERIOD OF AT LEAST SEVENTY-FIVE YEARS. WE WOULD RECOMMEND A PUBLICATION DATE OF TWO THOUSAND AND TWENTY-FIVE AT EARLIEST. IN THE MEANTIME, IT SHOULD BE PRESERVED USING THE HIGHEST SECURITY AVAILABLE; IT WOULD FORM THE MOST COMPROMISING MATERIAL IF IT SHOULD FALL INTO ENEMY HANDS.\n", + "\n" + ] + } + ], + "source": [ + "print(repunctuate(split_decipher(scb, pt_alpha, key_b), ptb))" + ] + }, + { + "cell_type": "code", + "execution_count": 138, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "7503" + ] + }, + "execution_count": 138, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open('ab.plaintext', 'w').write(repunctuate(split_decipher(scb, pt_alpha, key_b), ptb))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/2018/aa.ciphertext b/2018/aa.ciphertext new file mode 100644 index 0000000..f1bf626 --- /dev/null +++ b/2018/aa.ciphertext @@ -0,0 +1 @@ +010000100000100100010111100101000010101110101011010100100110100110000110001000110110100010100001001101101000101010110001010000110010100011100001000010101110111110001100011010100110101000010000001101000001000001011100000101110001000100100010001011010111000000000101000010100101000001001000000100101101100100110000110100110111110000101011100110001011010010110100101000111101101100111100000010100001001101101011010010000010001000000100001000100001011000010011010000110001111010110001000010100111000001001011001100100100111110101100100010100011001101000001111001000100101100010000110000101101001011100100001010000000110001001010010100001011100110001011000010110011001010000110100001000001111000010110110000100100100010011000011010110000010010111000110001001010100000000000111010001111010011001111000100111100000010100100110010101100110110111000100111000100111100100101011000100110010010001010110001000101001010101110101000110101000101001010101110001011000010101001010010000110101011100010000000010000100000100001101010110100000010000011000010000010001000001010101100110011101000110100001010100100001001010001100010000110111101101011011100100000000011001110000001000101001100011100100000110011100100010000000011010110000000000001001010011110000000110000000010010110011110000110100001000100000001010011100110001000100101000110011111010101001011100101101001001000111101101101011010100001010010000000110101000100011001001010101101101100110001000010000010000000110011100010000010011110110100110001111010101010101000111110001011001000100000010001000000000001000100010110101110100000101011100001000001000011010110000100111100000010100110100000010011111010101111100110010010001100011010101011101000111101101011110011010110101111011000100010101100101011001110010010101100111100000110101000100100111100110001100010000110111101101011011100100000000011001111001001001001100101000011010110101100100001110000000110100000000000011010100010000010000010101001000100010001011110010000001100010000110100010010000110100100111100011000011100110011000001001001110001100101011000000010001001110000000010000001011011100101100000000011010100101001001010100101011110010010001101011010101111110010000110100010000010000100010010000001111011100010001011001010101000110001001010011000010100001010000010001001100110011110001000101000110010110000001011011010010100100101101101001011100110011010110101100010001101000001010001001010001010011110000000110011101011010001010000110011001001001001100101000011010110101100100001110000010011010100010010111000100000001011000100111100100101001001001010100001000010000010000100101010000001001010000101000101101000111110001011110100001100000101001110001011000010100011101110111101101100110101001100001001011001001010000101000101000010111110001000000011001100001101011011000000111000101011001000001000000100100101011000000101001110001001000111001101011001011000101010000110000010100111010100001100010001111000011001001101011101101010110100011110001011000000111100011000101100110000010010111000100000001010101100001011011010101100100100000101001011100010100011011110001000100011100110101011001000110000110011100010011000101001011000100100101000101011001001011101101000100000100010001001011000111100110101000101001011011111000000001001100010101111000000110001110100111000011100101101110000001011110000000011010110000000010100000010001010011110001000010001001100000111001000101100110010100000011111010100110000001100101011101000111110001001000111001101011001011000101010000010101011000011010110000010000101000101010011010110111001000110000010011100111101101100010100010110011011000010011001110101000101000010001110001000011010100010011100101000001011010110000110011100101010001000110101000101000010000100110001111000110001010010000001001001111000110001101110110000101001110010110010011000101110000011101100101011101000111110101100101001111000100110110001110101000101010010011100110100001100010101010010011100100000110001000001010110101000111110001001000111001101011001011000101010000110000010100110010010001100011010101011011110000100110001111010101100011101001101011100111100000110011100111001001001001001101100101011001110000100101010100010010011010100101010001010000010101000111110001100101000100011001010000010101100110101000110011100111000111011011010000010100100000110100001000001110100000010000001101100100001000110011010100111000000001001101000000101011000001010100110100010000111011000111010111010001011101000000010001001001000101011110010101110001100111000100110011000000001110101000101000101000010001110101011011011100100011110000100110001111100110000001100100000100010000101010000001010110011001001001010000000100100100001100110000101001100001000110000101100110100001100110011000000110000000010010110101000111110101011011011110001010001000000101101101010101001011001011100100011100101000010000110000110001000110001110010100110000110100000000110000010000100110010001011011100101010100001011000100100111000101011101000100000110100100010101010001010000110101011001010111000011100101101001001000010000010001010101110001000110101001100010111010100001101100110100101000010000100110001111100110000011011000010011001110101011000011001001110100000000110000010000100110010001011011000111001011110001000110000001011010001001011100101101100000101100110000111001001111000000001001001000100100001111010100101001100010000110001101000110011110010000011100100110001000100010000010000100000100100010111100100011110000101101011110011001111011110001101101010110101001100000111011000000100111100101011101010110000110100010111100110011100111000110011101001101111000010101010111100111100000010100110100010010001001100000010010111010110001101100001100010101001011000001101101010101001011000000100001000000100101000011010110000110011100001000010000010001110001000010101110001101000111110001000110010100000101011010010001011010101010000101000110001101011000100000010101001100110001000000101000010001000000100001000000100111000001100110010000010000100110001000011010101111001001010001100101111010100110001111010100000011111100100100010001010001100100100010010101100111100001010011110000000110011101011010001010000110010011101001000101111001000000011000001001000110011010011010110011000000100101010000011001111000100111010111000011010000100001101101000110001000110111100001101011010101111101010000001101100100110100010101111011000100010101010100001011111010110001011101011010001010000110011001001111000100001010101011010101011011010100001101000111110001100101000110000001101100100001011000101000101001010000001101011110011000010100100000001101011011010010100000010000001101011011010110101100000110000100010001010101011000110110010000000010010101010000100101110101100100011001100100110100011000001000111001101001011100100110100100010100101001010010000001100010000100010001000010010101100111100010010100110010001101100111001100101010011010110011100111100000010001010010100010010110010110000010010001110001100101011001100100100100000000110001001100101000011010110011001000100101010011111010110101100110010101111010011010110011101011100111001100100100000110010000010101011000011010110000100111010101010100000110000100000000101010010100100110001101011011010000100001011010110001100011000101001011000011010111001001010101101010011010110011101000100100000000011001111001010000101010001000011001010001100101000110000100000110001111010001000101001101000110011001011111010101111000011010010001011010101010001011110101100001100111100011000101000010000001100010000100011101011001111000100111100101010001010100000000000110110100010101110110000100001001011101001000010101100001001010101000101001010101000001011000011011000011100011001101011011010010001010000110010001101110011000010100100000110101100101010111000001100000110001100010100100010101100110000000100111010100010011100111100001101000100010000101110110001001001000100000010001110110000110100111100101011001110000110101100011010100001000011010110000000000100100010010010111010100100111010100010011100100000010011110100001100000010101010100001001010000110000100110010011000000010010001011110010000001011011010000010100101000010010101101010110100011110001011000000110001111000011100100010011001000101001100100110100001000001000101000101001011011101101011111010101111100110100100111100111010110011001011010100110101001000101001011000011000110001111010100011010011010101101010111001101100001110000100111100010010000010001000100000000000110101000101001011001101101100100101010001101011010001110010111010101111001100110011000010111100101011101001011000010010111000100000001010010010001001111000100001011010100000000000001011100010001000000100001001100001010010001010000110100001001001001111011111001010001011011001101100001110100101101000100000110001011110111010001100111100000010100100100000000000110110100110101000111101101011001100101001001001011100100011100101000010100110000100110001111010110001011111011100110101000100001011001010101100100000001100110000010011010110011000000011001001000010000110010011100100001010101011011100110001110100001100101010111010100100111100000010000110110000000100110100011000011001011110101010110001011000100100000100001011110100000010100110110000000100110101110000101111000000110001110101000101001010100100001011100000110100001010111101101000110100100010001011010101110110000101000101001011001110101001101100010001011110110100110001111010100010011100101100001100101001101100100000110010101100110110111000100110100101101001101011100010001000100000000000110100100010000110001000100001001010011000011100101110100000000100001111110010000100001011100000100110101000010010101100111100000101010011010000110001111010110000100000110001111010001000101001001101011000100000101010110000100110110001111101000100000010001000000110100001001010101011101001100101101011011001100010100110000100001100111100000010100110111101101000110010110100000011100101111001111100110011001010100000000000111100101001001010110100110100110010100100001010000100101011100001100010100111001110001001000011010100001011010010001100110101000101001011010110001101110101000001000010011000110011101011101100101000111100100011100101100100010000000110100001000011011000100000110000100100101100011000100101100101011001111000100001100110000101101100010101000010001001011000000100111100000010001000110001111100010111101101101000101100001010000010000100000011001111000100111100000010101010000000111000000001000000010000110001111010100100100011100100110000011101001010101011000110011001101011011000101001110010000010101100101100101011001000110001010011101011000000011111000000000000101100100001001011010101111001001000101011001000000000001011100010010001010000110010000010000100110001100101000001110101000101000110011111010100101101101010101111001011100110001010111000110001010010001110001010110111100011011000100000110100100010100110101000010001101100101001101001001010100000100010110111101011011110000101101100101100101010100001001110001000101000100001001011010100111100100010101111100110001001110100100101000110101000001000110010000010101011000111000000010001111010101111000011010110000101101010110000101000100000100100111010100001101001100101011010000010000100100111011011001001000010100011101000111110001010001010000010000010000001001001001100011000001000110100001101000010000001010011010101110010111000100000010110000001111011101010000010000101011000001010101100110001101001011000001010100101110000011001011000000001101010101111101000111101101011010110100010010000100010000001000111001101001010101000110001001010011001101010000101101001010101000010100100100010010001000110100001000010011000101101101010100101000010101100110001111010100010011100000110101100011010110000001010000110000001001001100110100000111110001100011010100001000011010110000001111000100001000100110010011101000010010001010000110001101011011000101001110010000010101100101100011000100101100101011001111000100001100111001110101001101100010001011000011010000010001011000011001011100110001011010101000110011100000110001100011010110000101000000010010100010010101010011010110010101101101000110000001100100000101000101100101011000010000110001000111001010110101000111110001010000010010000010010111010100100110100100110011100000100001000000010001100011000101110001100010110101100100101001110000101101100000110011000110010100000000100001111110010010001101100101011001100000110001000101100101010100001011111010101001001110111110001010000110000101001001010001100000110001011001001000010010001100111010010101001101100010001010000100001000001001000101011110010101000001011010101000010011011011100001100011000101111110010000010101001100010000110001101000001111000000010000000001010100100001100111100010001101011100100000001001010001100101010000100110011101001000010010011010000010011100100010001000011010100110001111100110000101001011000100110000001111000101000000110001100010100111000011100101101101100100001111000100100010100101000001100100001010010000100110001000010000001100110000100001100011010101101001010100000110010000101010000001011001110010011111010101111100111011000000000000001001001110011000001001011100101101001001000100110001100111100000010101110100000101011010101010001010000110010010010000100010000101001011110001100010100101100011100000100001100101000110110010010000101101011011010000101001010010000001011010101011001001010000110100001000001011000100110000101110101000101000011011111100100111100100101000101001011011100001010000010010001101110100000101100111100011000101000100000101101101010101111001010100010000011000010101111001010010010001000011010100100000011010100110011100100100010001010000110100001000011011000100100100011000010111010101001100110100110001100110110100010001011010101110010111000100000010110000001001011100100001001001000100000000000110010110010100101011001001011011000101011001001000000110101101000110000011101011000110000100010101010001101011000100100111000111001011000110000100001001000100001010011010110011101101100000010011100010010001001100010110001101001011000110001111010111001000010101010111011101011010001010000110001110011100010101000000011001111000000011010100000000011010010001000100001000010000011100100110001111010111001011111011010111101101000110000000010101000110101001000101001011000011001101000101100110011010011001100101001000100010011010010101010001100011010101101011111100100110011100010010001010000110000101001111000100001011110010001101100011001100101010010001110001000100001001100100111000000000001101100110001001001011001001011011000101011001000111010101101011100101011001111100110001000000100101100011100000001001001110111111001011000100001111010101100011000001000100110001001000010010001011111011000101101001001100000001010000000101001010101101001000011010110000001111100110000000010101000110010000110000110101001000010001100101100011000001000100101101000110001010110001000110000101100111000111001010011001110101100101010100001101000111110001000011000101001010110100000000100100101000101001011100110001011110010101111101000000100100000001001100010001000100010000010000100000010000110000111000010000010000010001101100100001011000101000101001010100100111010111011111000100101000001101011011001101111010010000010101100100101001100011000100000110001000100010001100100100010011001001010000110001010000010011010000110000010011100111110101100101010111000100101001101011001000010010001010000001000101010001000110000011010110100001100011100000110100111010110001101100001100010101000111100001000110100101100001100000010100000001010001100101110101110101011110001001100011010100001111110001100100101011111010110001100100101001001110010100110001010111100100010101100110010100001000010000010101100110000100011001010111000011100000100110011101001101100100110000100101011100001111000011100011011000010000110000010100110100100111100111100110001100110110010001011001010100001000111001110001000000100000011100101011011001100111100000010100100110000010011100100010001101000111101101100111001001001000010101010111100101100101011101000110000100001011010101111001011010101111001001100101011001101011000100001001100100100011100101100001011001010110000101001000001111011110010101001010010000110101000100100100101000010101110100000001010000001010011100110001000100010101011100110110000011101001010101011000110110000101010000101001001011111011010111001001010011000011001001100110011100010100011000011010010101010111100111000100100100000000000111100100011011110001000100001000010000010011011000010001100100110111000011100000110001000110101001100001001000000101000100100000010001001000000110101000100110100010000110000000101101010100000011111010000010010111000100110011100110010000000001001001100101010000100110001111010100110100101000000000100111010101111001100110000100001000010000000001011000000000000110010101010001010000000110010001001101101011111001110101100111100100000100110000110100001000010010001010000110000101001000011011000100000110000100100100110101100101011001110000000011010110001010000110010101000111010111000011001001000001011000011001111011111010001101100110001111000101000110000100010001000101001010010000111000011100010101000001010101111000010000000100010101110110001001001000100000010011100000110110101000100110001101101000001111100111100101010100111011010010100111100000010100110110000110000001001110001010010101000101101101010100101000010101110101011010110000010011100000110001000110100101100011010110000001001010101000101001011010010001100111100001100001000000000001101000100010000001011001101000001000100111001000010101010111010000010010001010000110000000010000010000010101000110010001011010101000101000110110000000100110101101111110010111101101100010100010110100000001000110011100101110001000011100110001100000101100010100110000110010011100100011000011100100011000110000100110001100110000100001101100010101111010111011000000100011010100000001011010100110100101100100100011100100011000100100101001111000010110110010010001001110001011110000010001001001100100011101000111110001100011010110100000010000001101011010111110001010001000000000001100101001100100110001010011001101010110000101000010010100011100110111000100111100110001100100011001100011100000010101000010001000010001101011000100100101010101011001001000000000001100001100010011111010100110001111010100101101011010100110001010010101111101000111110001010100010101010100001100100001011001000110001001101000011000001000100110001010000110000100001000110111000100111010100110011000101100000010000100000000000111001100010100100000101101010000010001001110011010100001100111100000110011100111000110011100001000110011101001010101100110101001100001101011000100001001100100100011100111000001101011010101111011101010010001011010101011000000110000110101011100010000110101000010001101100100011110010010010000110001011110010110000100111000001110010111010110001010000100000110100111100000110100110010001101100100101000101001010010000001100010000101100001101011000000001000010100011101000111110001000100100000110011011000000000000000001001011001010000101001011100100001000100110000110100000000101000101000010101110011100010010110100011100001000010000001011010001001011100100110001111010100011000011001111000011101011010001010000110000101011100110000110001010000100101011001000101111010110110000110011001000101011010011011100111010111000110001010011011000000010000100111000011000001001111100011000110001010010001110001000010101110000010011010110001100100100111000011100101101101100110101011000000111001000101011100010000100011110001110001100010010001010001011010100110000100100000010001001000001110010000001000110101000011001101100011010111000101100110000100110001010100011001100110001111100111100110011001010010001101110000101001100011011011001000001000110100101011111001110001011001000101111010110110000110100100101000101001010101100001000100101101010001011010100110100100100110001011111001110001011011011001111011111010000110001111010111000100100101010100010000110000010101110110000100001000100110001010011001111000011100101110001101000111110001100011010110000011111010010001101101100000010100100110001101011011010000110101000010001101100100011001100100110000010101000010001000010101000111101101100110101000101001010011001111011100010010001000011000000000001001010000010011101011000111001101100010001011110110011001000011000101111100100100000101100100101110000000100001000110100111100011000101000000010001001000001100010001000001000000010111100101000001011001101011101101100001100001010001110001100010110101111011110000110001100111100000010000111001100001100100101101111001011100110001011110010101111101000111101101000111001000010001011010100110001110010101111011110001010011001111000101011001001000000110000111100100001011100000100101001001010101010011001000010111001000001010110101000111110001110001100011000001001001110001001010101011000011100011000110001111100101011001111000011001011110010101111101000100000000100110010101011101000111110001100101100000010011000001110001100101001010010101000000110101011001010110100011110001011000000110101000010011001001110100000000100001111110010000010001100111000110100000010000101111001111100101011000110100000101001001000101011110010000110100010000010000100100110001000100001011000100000001010101101101011011010011000100111001010001000110001100010101001011010111001001010101101000011010110001110001010101100011100000110100001001001001001000010101010111011001000101111010110110000110100100101001100011110100000101010000100110010100111011110001000100101000010001000000110100001000100100101000010101100001101101000101111000110111110101101011010110001000010100111000001001000101101100000110001101100011010100001000011001110101100110101001001001011001101101100111010101111010011010110100010000100100101001010100010000100000101111000100100000110001100010100100011101011001111000110000100000010100110000100001100011010100001000011010110000010001000110000100110001011001001001010000000011111010000010010111010110001001011001101011000111100110000000011100111001001001010000110100100110000110101000100001011001010101100110011100101000101001011001110101000010100011000100100011000110011101011000110011101000000101001110101000101001011000100001000011100100101000010101100101100111000101111101000110010000000010101110001101110111110001011010101000101001010011000001001011011000010100100110010000011001010111000011100110001001000100010101011101001100101101000100101000110100100110010010101000100100010001001000010100000001010011000000100110000110100111010101111011110110110010001000100010001010000110000110000001001001001001010010001101100101100101011000011010100001001011011000110000110110000000001000111010001101001011010100000000100001111110010000001001010000101000101011010011000000000000001100010011111010100110001111010100001011111011000100 diff --git a/2018/aa.plaintext b/2018/aa.plaintext new file mode 100644 index 0000000..3c14f42 --- /dev/null +++ b/2018/aa.plaintext @@ -0,0 +1,57 @@ +harry had insisted we place the hole where it wouldnt be seen later i was pretty sure now that he +planned to claim the table for his office so he suggested we remove the makers nameplate and drill +there it was just as well he did the demolition charge was linked to a web of mechanical detonators +and almost any other direction would have disturbed atleast one of them the machinery was old and +the sappers werent happy working with it but mechanical mechanisms can be easier to work with than +electronics as you can see how everything is connected a judicious dose of superglue fixed most of +the mechanisms in place just leaving us with the problem of what to do with a heap of old and +unstable explosives normally we would have placed one or two of our own detonators and packed out +the place with sandbags and breeze blocks to contain the explosion and i think even harry might have +been convinced that that is what we should do in this case but unfortunately the explosives were not +the only thing we could see inside the safe sitting under them was a slim black book we couldnt see +any details but having got this far it seemed crazy to destroy it anything this well protected must +have been important at sometime and we needed to know what this might all have been about after a +quick callback to headquarters harry got approval to continue trying to crack the safe he knew me +too well to ask me to leave but the documents team retreated to a safe distance down the corridor +with most of the guards leaving a small team to watch over us as we worked one of them had joined +the sas from the sappers and was an experienced bomb disposal expert so he worked with us watching +the explosives for any changes monitoring vibration and temperature and generally keeping us calm it +takes a special temperament to do that work full time and we were glad of the company and the +expertise after seventeen hours we were getting tired and as eighteen approached i began to wonder +if we would manage to save the papers but eventually the final cog turned and the last tumbler fell +into place we had managed to glue the broken cog back together and with a mild protest the top +turned raising a platform up through the central pillar to present us with the book we had seen by +the light of the endoscope it was bagged and secured and harry took it with him the special forces +secured the entrances to the shadow archive and i left to get some sleep we met the next day to go +through the papers harry had started on the decrypt doing all the usual checks frequency analysis +index of coincidence and soon the distributions were relatively flat so it was clearly not a simple +caden us or substitution cipher and we started trying some of the ideas we had found in blacks +codebook it took us longer than we had expected but after a few days we had the entire set +deciphered and had begun the analysis harry had slightly different interests from me i was +fascinated by the insights into an older world while harry was focussed on why these documents might +have any contemporary significance both turned out to be important history matters and as marx said +it tends to repeat itself personally i would be the wasnt the first person to say it and he wont be +the last but for us the point was that as we read more we began to see the parallels between blacks +world and our own and it was not comfortable reading when we got to the back of the book all became +clear the book was actually a civil service report on the shadow archive closing it down and giving +reasons why black had been too successful and his activities had badly destabilised the balkans the +report traced a direct line from the bulgarian crisis to later tragedies given his early enthusiasm +for his new methods of shadow diplomacy i honestly believe he never meant to cost so many lives but +it seemed clear from the report that blacks interference in foreign domestic politics had had dire +consequences it looked all too familiar and if our enemies wanted to discredit us when we complained +about their interference in domestic politics then these papers would be the ideal kom prom at +material it looked like we werent just victims of these tactics we had invented some of the methods +ourselves back in the nineteenth century harry put out a request for analysts to work on recent +signals traffic to see if there was anything to suggest who was responsible for sending me on the +hunt for the kom prom at files there wasnt much and certainly nothing to link it to foreign +government action it was quite possible that this was the work of one of the criminal networks that +had grownup after the fall of the soviets market manipulation is a lucrative business and attacks on +government credibility area very effective way to move whole markets the documents stolen from the +archive were still out there somewhere and it was possible that they contained enough to embarrass +us but that seemed unlikely whoever wrote the closure report had been thorough and it didnt seem +likely they had left anything important on the shelves but time would tell harry set a watch in case +anything surfaced and asked me to keep an eye on the black markets too as i suspected the shadow +archive table appeared a little later in his headquarters fully restored and i assumed completely +disarmed i returned to the library to finish the job i had started but when they offered me a new +contract i refused i had a better offer the table was in an office next to harrys with my name on +the door \ No newline at end of file diff --git a/2018/ab.ciphertext b/2018/ab.ciphertext new file mode 100644 index 0000000..2419e56 --- /dev/null +++ b/2018/ab.ciphertext @@ -0,0 +1,5 @@ +TSTJAN FP JON PVZDYPRFXTFEX, NQWKEJLOPJKHQ WYJ VZDEBRZB FG JON FXCOVE GADBJLI; KTNB TSGJYIKPUWATSUH. HCH CSST SHNF SUMN. +XFTV YFFCHD HCH ZCXYCWHDCYPZ IZ JON QSYFDKY FOJTSXGAT ZW IIZKMZ WE XFP VZTKGAOMKH TRI IDZJLLATOW WH XFP LSDQL-RZZKQSRIPJZ JEXNXGNISRMP YMFEGB, DXK HRWIKH CTZORWO, BFIIGQNKT IIPPMYFU XJ IV ZAS WHNXNXS. XFP MKQVVA NSUUTLYF MKEVQXPJEDJLJZV LWI WMDCFPQ GJZDKTELYR NBF TVMGCHF, TD KPGR DQ W EOITDIH JQ GKHQCYF GKDIRNJ WYWC WYIGDHDD JQ CZH TGATQNUDIE. TN CMQC MKJZDDRE I AYJSJ EOITDIH JQ NBF ZYHAOUU TDEPNW WH XFP YYERLOP YUO IIMKITFEBGDCFPQ WE DS ZAS YEP SY ODDZKVCM VJ AGSWF TDEPNW. +URI EGYEWX WHNXNXS LE IJ NPUIZPJEFEX RZNKMBLQPJJF TKNZDD HSX DS AD URI ZACHDJI EPDYFJWHC NF ASV XIEKHJH SOOKP LLMDSYJT LY DXK MTXN PCMAJINZNB ESRAOMD. JJ EGF OWUTFVTVBFU XJ NSUOKGA FPYXSLVXYUES WYJ NF ETVHC SSU ZCOPMZ ODTVKICUDG GNNNWED IPVNIEII DS LVIXFPM ZAS LYDOYFQXE KW BFI QGUOWUN’D QKQKTEQNZN, GADPN SMFXDBRZB CP SPNYOUU VJ ZXYSHDFVP ZKPDWLTGNUN LY DXK FLIYD NBDJ LAF YJUDZRDCKH XIHP ZNHZCOPMKO. QGGZN EWZYXPJZDJLJZ VZJBP NBCWUQ JHKI ZADD EDYMF VJ AGO KHJWLXCWACIYD SL URI GADBJLI, AGSSIR KRWOU URI IPGNETXN ZYZVII JQ CZH VTNAYZJVRE, TN TDN FN DXCU LIHC WKB QYMG ZFEKQNZNW BSVN PQKT XVRDNKP. JON QOG URWA JS YFCWRZ YYF YH YINSTS THTQCUS GJYISPDGGDCFPQ WYJ KKTQCYIG YFZCHJV. +NP FWHDCJVBWH DXKTS WZSOCTQ XJ GYHF YINZ Y JWIVNFKFPUIYNO IFJENPJ BFI QGUOWUN WYJ DBDIPNF BYFN GJZDKTELYR NBF EINJ WFT QYMG YU WIKGZCWDJLJZ, NBWKKF KJRZ T JNL SL URCEP GKUJIHF YYF VR PTGK JE XFP KYJLWAP MFZTP MKGRFZXRKJ. NU DD EOMTJQII DXCU VXFPM RFJXNAV JWEGNAJNPA XFP MKEIYRDIKPJ CP MGCEW WE DXK GDVED XKDU CP DXK DIGFTQK NKDA GYHF SSRFNKO, YYA IJ KPJLHP AFY VJ IKDSNSRAF WYWC XFIN VFILJJ CW NDDETJM BDXF ZS NPUIW QCRF JC APGR VQ EFIN NU ZCYDYNPSB. JOM NPLIEDCMDJLJZV NPJC LXYJL QOJL NBDJ ON LYW TSPGDOE UV KHPT, CPU XFIN BF IIAOMUFU JHKI IWQXJZ ICHQWMGPWFJXE DS ZDWI DS MKHDBNZDK JE PJZZFP. RLE TITFULGDO LDCLVC HKTS RJD HKDBXFC, NBWKKF GO BDU FNPJ C TSPGDCHFBH EODJFQDPOG JTDQRZYR JE XFP PUJJII FNCUSD, GZZ JWEXNYKFTTVB AOJWIBE FPMISDA DXCU RI FIZ KHJWLXCWASB RZZKQSRIPJZ NSWYF. JF TSGJAZ FG RLE PIVMVHXPJZ ETR LP WFVEB, FKHKXSV EPQKTTP JQ NBF SSAIJZ OVGDYOUUQ JHKI MTSH’E SOYHVRGX DFMBIMDCFP RLYD NBDJ FVIDQ BTD HPDYVDXNJ YW ASV XIEKHJH’E QCYHJ DNNMKU QIMAOZDIH, EK NBF TFEPJJF VJ GZT EWZYXPJZDJLJZ CW VEDDAKYJQLYR. ARDZN UPKZ D FIHFSUDB MJOMUDB EFTDB EVRAICUFU DJYO NPJIHPVZJEK IPNCJBD, QTQNPA YE FSTF DRETBBU DRAK XNH FIHFSUDBLAC, YUO DX RF DRFTV AGYZ AS XFACHFU CY IZHFEXDAO. SPHCHDPUDJIVC, NBF LCVOIKH IIVINNPA XJ GCW QSVRKZ NP BCYJSU DII GXVF NDDETJM, HV EN NYUPVX HPGD WE XFPI ZW HLVX CU URI XTVWJEK IPNCJBD JQ XNH IIMAPNUCIYD NF URI GADBJLI. YKJKURIVPVW D EYXMOY WH YYKWLJZLGX MKEVVIF ICJEXGTJKO YH XPIIFID JQ NBF HCHPCMP QIMAOZDIH’E JOVDIXXPJZ HKKQPVZ URWA DXK FMLEDOUES CP DXK DIGFTQK, BRLVP SLGDGRIGRZ UIYTOE, BTD UZSGP JC G FICMB RDYAKT VJ XPIIFID JQ NBF DRAPGRJAIYNO JWCQDZCZZ DR VKJEWE. LY SYYUDGDXYY URI NFNCCBLEGIKPJ CP GOCOGYGANKTQ LY FDFUBWYJ TCTU EGF Y YFBWATQKMN CZPJ WFZVND, KYFQYXIARZ YIMIPWF JON SSRJZI AGOTHSPOPV GFII GLYYF JOGD VFNSXFTJM VEYEOYR BTD QKCUI VR, AGSSIR XFP JCNS WYJ YJUDZRDCKH VJ AGO FTAWYTVCUDCY LOYF T GVKVKMN KDIMEFU DNNMKU. JON ZYTF QOGJSG DIGFTQK OVIE ZSZ DFTNIM FP TRB KWLJZLGX ZFEKQNZNW GICX DXK QSVRKZ. CH JON FDCMS CP MGCEW’D JSOYDJLJZV MTSE RZ NBF CLI PCMAJINZ VKXSRATOW, TKQJOMW WH LAF YJUDZRDCKH TPEK BYFX WYJ CZ HSIXF NF ATZN MOKP JORF, YW NKGF IV ZAS RNPZ ZW SDAIARJQO G FOJVII VKDCUDCY QSY ADD QASGJEK MKGRFZXRKJ FG DRAPGRJAIYNO VDFIHF, NBDJ DNPIW UV OGWO RFU FVIDQ UV XFP ZKXSPJSIKPJ CP DXK VEBNABYWKRI XYIZILYDX IFEIGDX ZAS HGAZ. ZAS IWDMCWIBRZYYZ ZCED SL URLE NSSMU RJD AK QICZPMRZ ZCYNOCMSB GZZ ZADD VPZ ZW GYNFNNWED RZ NBF RCDFO GADGF TJ ZVIR, RQ TFV XLVX OAEKDN DXK QKR, IASHF JON IMJADZN QPYURIH OJEFIKHKPUO. JOJFO MWLIHZIKPJ QRZCWUILNF HBJZO FIZ BJJONANF CSIY MOUFHLMTYYJSD JQ NBF DRAPGRJAIYNO EDJW GZZ CPTPBFCW QICIODKO YH LXYJL’Q CZPMCUDZNF JFB ZCXSGKUSPB JCWUTRMPZ ZASQEPGHFQ, WYJ XK HSIXF NF ATZN MOJWCI GZ YRNVDA PJZJIIVC WYFS WQPJZ, HSXATJM ADD JLJ VWBLATDCM TRI JCVMVQGDCJ IVWVF HNUR XFP NCEDX EOKVWIX JQ NBF FWVIDK. OKVRZB ZADD ZPMNWU, FVIDQ BTD PKDSHQII XYYISPB KJ EFQXGMCRJQLYR MSHQLGZ, BKTCWY IJE DKDAACCP DQZPMNDBLED OAQTRETSU JE XFP ACMWWYF MKIDCY, IJE WE XFP JKFU XJ SMFUSGA DXK NSBRDOYTTRNIJ ZTTBN ASSUSD. FP VKFCD AK XCXS BNWORWFII IJ KYJIYFCHF EIALSYL VJ GROUUQ LY DXK TSKRKJ, IVJ QJAO NNFCHDYUUBH AK XCXS BNWORWFII ZOG NSXFKZW WH EJAFNPA. EFTGK EBWEFCJDB BRSGFNTGB GYE DBEGCV YFBLNJ SU FQTRKJCIS, FVIDQ FQXGMGNHRII ZOG EVZNAN TFJOJJV ZW ULEAPVU JON JCVMVQGDCJ DZXRWCZJSD JQ KFUSRATYR WFTJFCZJVR, LC KRDZLYR YMFEXE LCZADR AGONT YYHPYSEIWMTOW. EVRAASRMDRQ DXK DAIYJY FG DQZKMZDEX RZNKTEWATSUDB QNPNNPAD, FP HCH TFVP, YZ MSWED CU QTVA, DS JWEXHKG ZAS CDDDFNS CP ZOMWJLGDCFPQ, WYJ NF CSRNQCZ GICX TJWJUI UZSGMSBQP SL URCEP ZKMDFNAYZJVRE. GO BDU TGANNEKPGA VSEZIEF ZSTDRQ DXK QSVRKZ FG JON MPRITVRIJ CPU FGXFCPQ GHTVKH ULEAPVUDRQ DXK DBPRIJJF YYRXZNPA FNDHKFE XFP NBTSI NYKKTVVE. TW BF RWI AOWUILMDOE ADQEPGL UV IYRYMJEK KTNB URI XIEFT FCKPMW JE XFTV GDN ORF MKEVVI LSSMU OGWO IFSR HPBCTUII IV C HDKYTWNETRA FPJESDE IJE URI EOAZMSXB KW BJQ QNDXFOQ QGC HKMB OGWO GWE ORY WYJSRIF CU ADKF RSHFIRXPJZ. URI EVCRGKP KIT NP XORNX BF CWYTKSMTXNJ CUUSVYINNWEWV NSUXSRATSUH JC JOM IFEIPTN CU LIHC GNUJPN NSWU DR VTQKH FVJYCWFU XJ PVZDYPRFX C PSE KIT FG XCHVCUI YH EOAZFIJDRO NPQXNIZ FG XWH. OJLWIXDZYZFBH FTV HJZXJACKH SRMKPYDAII I IFTS VNNFRFQD GSKYWTGF IJE AS DNPIW UV OGWO KYFPJAOE NVVN PRZTSQN WOYHDCYF SL EVZNAN EJFPJYYJZ. RIHP MKEVVIF YZ URI GADBJLI APGR D CCHP DFNFPNDO WUVVB, DXFVAO PKM YFTDJZV ZATX KTGR CSGJYO JMSWH TJ C NVQNZN, GF RWOP DBWQIY DS YFCCOP YUO ZPGFVNGN, CH TJ WWCI MIVKH UIEDMFZ, JOJFO EWZYXPJZH XORNX UDIVGDO NU. JONAO NH ZPNIM KXDBNZDK URWA MGCEW DND PV VELAF HNURLY DXK DIGFTQK UV YYJOYUTNN LXCU RWOP AKEVQN VJFBE WE MGCEW CZPMCUDCYF. (YW DE WETZK, URI NDTTWBCQC SL URWA ZYTF XWE ZSZ EBIGA PUUDP AGO CTZORWO GDQ YYNSHFIII.) DXKHS DZPDNDBLEPZ NP YPGNFTDDP, LACIFIH GZZ VWBLATDCM TKRDYZJVR. KGCRF JONAO CTS RJ AOJWIBE KW BJAONA DYJCIE MONPA WDDXFTDDNJ AD URI GADBJLI, AGO CEJLOTVZH JONC HFTWII LCZA XIHP JFU TFJWO TVIBNA, YUO DX RF LSJJI ZASIDYPN DXCU JORF XCO YIMKIK DECAGOY UVCV KW ZAS RNDHFTW. XFP GFETP QASSQQ DDSKFTJII MT ZAS WHNXNXS ENAO VDIXRNPRDIPB IDZJLI RZ NBF YWVVYU HJWAPV CU JON PJE WH XFP JNPSXNPJZA ZIYDPYZ, TRI MGCEW JJNPWHSB JZ NYZDRQ DS EJQVDSN YVQDRIJ KYFWYFCFP YH EKHNPA BRFDFTU WXKJM CTPUIJ UDJLJZYRJQXE. MGCEW DNPIW UV OGWO YFJLHPZ LTVQ AGO CTZORWO CTVYYJ NBF JLXP SL XDGAKMND’Q BNINB, AVENWOY ADD EODJFQDJAV JWEXRZPKO RLE LSYL TRI LO BDLI DZDFXSVNJ OHJUIYNO FG T ORRXRZ TGATQK IICDS HFTWLYR PUOSV MKZK PTQN IMJATRQPG NP JON AOMJVR GASSPU RRZOZFSR ALORXS. YYQSYUKRGDORZ, DX EPOTH JOGD NBF QOGJSG DIGFTQK PSXKKMQ BTD LC NBJQ DAIBK HKTZKMZJEK GAIKO DREOMYFZXRKJ NP JON AOMJVR, GZZ GF YIVTOHF JOGD CZH TGATSUH CWB GYHF ZCYDMNCKXNJ, YZ MSWED CUODVNNNRZ, JC AGO KXSRAF GKDULYR NF URI PTMWU XCHXZ GDI. +XFTV LDZX GXSUF ZCDXZ JDKDN NSUHDBNAYIMS IXMYYTTDEYOUU JC AGO SL ACOPMUNSRA IJE BS JNPG GF RWOP JF WFXRKJ IVJ XJ AOJWCQNZZ ZATX AGO WATBJL YYERLOP YUO TPV TNW PSXKKMQH QOJOGE CS EJOJE VF, LAF ZFEKQNZNW DEWVCVKO, ZPGFVNGDII, IJE, JH RNNOWHTVB, JOWUICBPZ, CPU LAF YWHSXE JCWQVDNJ SL. URLE AOVWIX EGSSMU WVFS YFCWRZ DRDQDRQCKO HCH I KKTDCI KW CU BIGFN WFLIYDT-LJLI BPYYH. XI KKPRO IIMKITFEB G SPIMDGGDCFP UWAP SL UXC AGSSHTRI IJE UXIYDT-LJLI GD OCTBLNFN. NP JON YOCPJLXP, CZ HRCDXZ IF FVNFOYXSB DFCUI JON GCMASDA FOJVILAC YHDDPGMGK; JJ EJOGE GVVX DXK NVDA NSTQICXTVNPA QGDOYJTP RQ CZ HRCDXZ LDBP RZNF FEIXC XCPUD. diff --git a/2018/ab.plaintext b/2018/ab.plaintext new file mode 100644 index 0000000..5c64741 --- /dev/null +++ b/2018/ab.plaintext @@ -0,0 +1,5 @@ +REPORT ON THE ESTABLISHMENT, EFFECTIVENESS AND STANDING OF THE SHADOW ARCHIVE; WITH RECOMMENDATIONS. FOR YOUR EYES ONLY. +THIS REPORT WAS COMMISSIONED BY THE FOREIGN SECRETARY TO REPORT ON THE STRUCTURES AND ACTIVITIES OF THE QUASI-INDEPENDENT INTELLIGENCE AGENCY, THE SHADOW ARCHIVE, HEREAFTER REFERRED TO AS THE ARCHIVE. THE REPORT CONTAINS RECOMMENDATIONS FOR ACTIONS CONCERNING THE ARCHIVE, AS WELL AS A SUMMARY OF LESSONS LEARNED FROM ANALYSIS OF ITS ACTIVITIES. IT ALSO CONTAINS A BRIEF SUMMARY OF THE CURRENT ASSETS OF THE ARCHIVE AND RECOMMENDATIONS AS TO THE USE OR DISPOSAL OF THOSE ASSETS. +THE SHADOW ARCHIVE IS AN INDEPENDENT INTELLIGENCE AGENCY SET UP BY THE PRIVATE SECRETARY TO HER MAZESTY QUEEN VICTORIA IN THE LATE EIGHTEENTH CENTURY. IT WAS ESTABLISHED TO CONDUCT SURVEILLANCE AND TO CARRY OUT COVERT DIPLOMATIC ACTIONS DESIGNED TO FURTHER THE INTERESTS OF HER MAZESTY’S GOVERNMENT, WHILE PROVIDING AN ELEMENT OF PLAUSIBLE DENIABILITY IN THE EVENT THAT ITS ACTIVITIES WERE DISCOVERED. SCANT DOCUMENTATION STILL EXISTS FROM THIS STAGE OF THE ESTABLISHMENT OF THE ARCHIVE, THOUGH GIVEN THE DELICATE NATURE OF ITS OPERATIONS, IT MAY BE THAT VERY FEW SUCH DOCUMENTS WERE EVER WRITTEN. THE FEW THAT DO REMAIN ARE BY NATURE PRIVATE COMMUNICATIONS AND PERSONAL RECORDS. +IN PARTICULAR THERE APPEARS TO HAVE BEEN A CORRESPONDENCE BETWEEN HER MAZESTY AND CHARLES GREY CONCERNING THE NEED FOR SUCH AN ORGANISATION, THOUGH ONLY A FEW OF THOSE LETTERS ARE ON FILE IN THE PRIVATE ROYAL COLLECTION. IT IS SURMISED THAT OTHER LETTERS CONCERNING THE RECRUITMENT OF BLACK AS THE FIRST HEAD OF THE ARCHIVE MUST HAVE EXISTED, BUT AN ENTIRE BOX OF DOCUMENTS FROM THAT PERIOD IS MISSING WITH NO INDEX FILE TO TELL US WHAT IT CONTAINED. OUR INVESTIGATIONS INTO BLACK SHOW THAT HE WAS RELATED TO GREY, AND THAT HE RETURNED FROM BOSTON MASSACHUSETTS TO TAKE UP RESIDENCE IN LONDON. HIS IMMEDIATE FAMILY WERE NOT WEALTHY, THOUGH HE HAD BEEN A RELATIVELY SUCCESSFUL CRIMINAL IN THE UNITED STATES, AND CONTEMPORARY RECORDS SUGGEST THAT HE HAD ESTABLISHED INDEPENDENT MEANS. NO RECORD OF HIS EMPLOYMENT CAN BE FOUND, HOWEVER SEVERAL OF THE EXTANT DOCUMENTS FROM GREY’S PERSONAL COLLECTION HINT THAT BLACK WAS RECRUITED AS HER MAZESTY’S FIRST SECRET SECRETARY, SO THE ABSENCE OF ANY DOCUMENTATION IS UNSURPRISING. BLACK KEPT A PERSONAL JOURNAL WHICH CONTAINED SOME INTERESTING DETAILS, GIVING US SOME INSIGHT INTO HIS PERSONALITY, AND IT IS CLEAR THAT HE THRIVED ON ADVENTURE. UNFORTUNATELY, THE VOLUMES RELATING TO HIS PERIOD IN LONDON ARE ALSO MISSING, SO WE CANNOT RELY ON THEM TO FILL IN THE MISSING DETAILS OF HIS RECRUITMENT TO THE ARCHIVE. NONETHELESS A NUMBER OF UNOFFICIAL RECORDS MAINTAINED BY MEMBERS OF THE FOREIGN SECRETARY’S DEPARTMENT SUGGEST THAT THE EXISTENCE OF THE ARCHIVE, WHILE OFFICIALLY DENIED, WAS KNOWN TO A SMALL NUMBER OF MEMBERS OF THE INTELLIGENCE COMMUNITY IN LONDON. IN PARTICULAR THE ESTABLISHMENT OF HEADQUARTERS IN SCOTLAND YARD WAS A RELATIVELY OPEN SECRET, PRESUMABLY BECAUSE THE POLICE THEMSELVES WERE AWARE THAT SOMETHING UNUSUAL WAS GOING ON, THOUGH THE NAME AND ACTIVITIES OF THE ORGANISATION WERE A CLOSELY GUARDED SECRET. THE NAME SHADOW ARCHIVE DOES NOT APPEAR ON ANY OFFICIAL DOCUMENTS FROM THE PERIOD. AS THE SCALE OF BLACK’S OPERATIONS GREW IN THE MID EIGHTEEN SEVENTIES, RUMOURS OF ITS ACTIVITIES ALSO GREW AND IT SEEMS TO HAVE BEEN THIS, AS MUCH AS THE NEED TO ESTABLISH A SECURE LOCATION FOR HIS GROWING COLLECTION OF INTELLIGENCE PAPERS, THAT SEEMS TO HAVE LED BLACK TO THE DEVELOPMENT OF THE UNDERGROUND LABYRINTH BENEATH THE YARD. THE EXTRAORDINARY COST OF THIS COULD NOT BE PROPERLY CONCEALED AND THIS LED TO QUESTIONS IN THE HOUSE WHICH IN TURN, IF YOU WILL EXCUSE THE PUN, DROVE THE ARCHIVE FURTHER UNDERGROUND. THOSE GOVERNMENT MINISTRIES WHICH HAD HITHERTO BEEN BENEFICIARIES OF THE INTELLIGENCE DATA AND ANALYSIS PRODUCED BY BLACK’S OPERATIVES NOW COMPLETELY DISTANCED THEMSELVES, AND HE SEEMS TO HAVE BECOME AN ALMOST ENTIRELY FREE AGENT, SETTING HIS OWN POLITICAL AND DIPLOMATIC GOALS WITH THE TACIT SUPPORT OF THE PALACE. DURING THIS PERIOD, BLACK WAS FOCUSSED LARGELY ON DESTABILISING RUSSIAN, GERMAN AND AUSTRIAN IMPERIALIST EXPANSION IN THE BALKANS REGION, AND ON THE NEED TO PROTECT THE MEDITERRANEAN TRADE ROUTES. HE SEEMS TO HAVE DEVELOPED AN EXTENSIVE NETWORK OF AGENTS IN THE REGION, BUT MORE IMPORTANTLY TO HAVE DEVELOPED NEW METHODS OF WORKING. WHILE CLASSICAL DIPLOMACY HAD ALWAYS RELIED ON ESPIONAGE, BLACK ESTABLISHED NEW COVERT METHODS TO DISRUPT THE DIPLOMATIC ACTIVITIES OF POTENTIAL OPPOSITION, BY PLACING AGENTS WITHIN THEIR BUREAUCRACIES. CONTROLLING THE AGENDA OF IMPORTANT INTERNATIONAL MEETINGS, HE WAS ABLE, AT LEAST IN PART, TO CONTROL THE OUTCOME OF NEGOTIATIONS, AND TO BENEFIT FROM INSIDE KNOWLEDGE OF THOSE DELIBERATIONS. HE HAD PARTICULAR SUCCESS DURING THE PERIOD OF THE BULGARIAN AND BALKANS CRISES DISRUPTING THE ALLIANCE BUILDING BETWEEN THE THREE EMPERORS. IF HE HAD RESTRICTED HIMSELF TO ENGAGING WITH THE MAZOR POWERS IN THIS WAY HIS RECORD WOULD HAVE BEEN REGARDED AS A SIGNIFICANT SUCCESS AND THE SUBTLETY OF HIS METHODS MAY WELL HAVE WON HIM FRIENDS IN HIGH GOVERNMENT. THE SKILFUL WAY IN WHICH HE MANIPULATED INTERNATIONAL CONVENTIONS TO OUR BENEFIT AT VERY LITTLE COST IN LIVES PROMISED TO ESTABLISH A NEW WAY OF WORKING BY SUBTERFUGE INSTEAD OF WAR. UNFORTUNATELY HIS VICTORIES ENCOURAGED A MORE RECKLESS APPROACH AND HE SEEMS TO HAVE EXPLORED MORE EXTREME VERSIONS OF COVERT DIPLOMACY. HERE RECORDS AT THE ARCHIVE TELL A MORE COMPLETE STORY, THOUGH FOR REASONS THAT WILL BECOME CLEAR IN A MOMENT, WE HAVE CHOSEN TO REMOVE AND CLASSIFY, OR IN SOME CASES DESTROY, THOSE DOCUMENTS WHICH NARRATE IT. THERE IS CLEAR EVIDENCE THAT BLACK SET UP UNITS WITHIN THE ARCHIVE TO UNDERTAKE WHAT HAVE BECOME KNOWN AS BLACK OPERATIONS. (AS AN ASIDE, THE ETYMOLOGY OF THAT NAME WAS NOT CLEAR UNTIL THE ARCHIVE WAS UNCOVERED.) THESE SPECIALISED IN BLACKMAIL, BRIBERY AND POLITICAL AGITATION. WHILE THERE ARE NO RECORDS OF HIGHER CRIMES BEING AUTHORISED BY THE ARCHIVE, THE ACTIVISTS THEY WORKED WITH WERE NOT ABOVE MURDER, AND IT IS QUITE PROBABLE THAT THIS HAD BECOME ANOTHER TOOL OF THE NETWORK. THE LOCAL GROUPS SUPPORTED BY THE ARCHIVE WERE PARTICULARLY ACTIVE IN THE BALKAN STATES AT THE END OF THE NINETEENTH CENTURY, AND BLACK FOCUSSED ON TRYING TO DISRUPT RUSSIAN EXPANSION BY SOWING DISCORD AMONG BALKAN NATIONALISTS. BLACK SEEMS TO HAVE RETIRED FROM THE ARCHIVE AROUND THE TIME OF VICTORIA’S DEATH, HOWEVER HIS SUCCESSORS CONTINUED HIS WORK AND WE HAVE UNCOVERED EVIDENCE OF A HIGHLY ACTIVE GROUP WORKING UNDER CODE NAME ARCHANGEL IN THE REGION AROUND NINETEEN TWELVE. UNFORTUNATELY, IT SEEMS THAT THE SHADOW ARCHIVE NETWORK WAS BY THIS STAGE SUPPORTING ARMED INSURRECTION IN THE REGION, AND WE BELIEVE THAT ITS ACTIONS MAY HAVE CONTRIBUTED, AT LEAST INDIRECTLY, TO THE EVENTS LEADING TO THE FIRST WORLD WAR. +THIS FACT ALONE COULD CAUSE CONSIDERABLE EMBARRASSMENT TO THE UK GOVERNMENT AND WE FEEL WE HAVE NO OPTION BUT TO RECOMMEND THAT THE SHADOW ARCHIVE AND ALL ITS NETWORKS SHOULD BE WOUND UP, ITS DOCUMENTS ANALYSED, CLASSIFIED, AND, IF NECESSARY, DESTROYED, AND ITS ASSETS DISPOSED OF. THIS REPORT SHOULD ALSO REMAIN CLASSIFIED FOR A PERIOD OF AT LEAST SEVENTY-FIVE YEARS. WE WOULD RECOMMEND A PUBLICATION DATE OF TWO THOUSAND AND TWENTY-FIVE AT EARLIEST. IN THE MEANTIME, IT SHOULD BE PRESERVED USING THE HIGHEST SECURITY AVAILABLE; IT WOULD FORM THE MOST COMPROMISING MATERIAL IF IT SHOULD FALL INTO ENEMY HANDS. -- 2.34.1