From: Neil Smith Date: Thu, 25 Nov 2021 17:03:27 +0000 (+0000) Subject: Done challenge 7 X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=bf4dff6375d2b1e7757a51a4c19402eacb30b903;p=cipher-challenge.git Done challenge 7 --- diff --git a/2021/2021-challenge7.ipynb b/2021/2021-challenge7.ipynb new file mode 100644 index 0000000..967060a --- /dev/null +++ b/2021/2021-challenge7.ipynb @@ -0,0 +1,547 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "5c19999b", + "metadata": { + "Collapsed": "false" + }, + "outputs": [], + "source": [ + "from szyfrow.caesar import *\n", + "from szyfrow.affine import *\n", + "from szyfrow.keyword_cipher import *\n", + "from szyfrow.column_transposition import *\n", + "from szyfrow.vigenere import *\n", + "from szyfrow.polybius import *\n", + "from szyfrow.support.text_prettify import *\n", + "\n", + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "\n", + "import collections\n", + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d9dd1b5e", + "metadata": { + "Collapsed": "false" + }, + "outputs": [], + "source": [ + "challenge_number = 7\n", + "plaintext_a_filename = f'plaintext.{challenge_number}a.txt'\n", + "plaintext_b_filename = f'plaintext.{challenge_number}b.txt'\n", + "ciphertext_a_filename = f'ciphertext.{challenge_number}a.txt'\n", + "ciphertext_b_filename = f'ciphertext.{challenge_number}b.txt'" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "0f1f792a", + "metadata": { + "Collapsed": "false" + }, + "outputs": [], + "source": [ + "nca = open(ciphertext_a_filename).read()\n", + "cb = open(ciphertext_b_filename).read()\n", + "\n", + "numtrans = ''.maketrans('12345', 'abcde')\n", + "ca = nca.translate(numtrans)\n", + "\n", + "sca = sanitise(ca)\n", + "rsca = cat(reversed(sca))\n", + "scb = sanitise(cb)\n", + "rscb = cat(reversed(scb))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "b8d5f9ec-27f1-498b-8e64-c5eb2424e581", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Counter({'e': 632, 'c': 619, 'a': 714, 'b': 410, 'd': 787})" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sca_counts = collections.Counter(sca)\n", + "sca_counts" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "b5cabba1-ac75-46ea-ac05-8699cc88d986", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD1CAYAAACrz7WZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAARfklEQVR4nO3dfYxd+V3f8fcnduKQ8BCbHRtje2MjTRe8EXnQ4GwbHmNgjdLiBWE0EaQW3ciV6pTwIBW7qhSCNNL+AYgHsUgWoR0eGmsIbNciUhpjiCIgiTOb3TSxN9ZO4409sWsPIYFAFQcv3/4xZ+sb7x3PtWeur/Pz+yVZ55zv+Z1zv3Nkf+7xmXPuTVUhSWrLi0bdgCRp9RnuktQgw12SGmS4S1KDDHdJapDhLkkNWjvqBgDuueee2r59+6jbkKSvKk888cTfVNVYv3V3RLhv376d2dnZUbchSV9VknxmqXVelpGkBg0U7kl+NsmpJJ9M8u4kL02yIcnxJM900/U94w8nmUtyJsmDw2tfktTPsuGeZAvw08BEVb0KWANMAoeAE1U1Dpzolkmys1t/P7AHeDTJmuG0L0nqZ9DLMmuBr0myFngZcAHYC0x366eBh7r5vcDRqrpSVWeBOWDXqnUsSVrWsuFeVZ8Ffhk4B1wE/q6q3g9sqqqL3ZiLwMZuky3A+Z5dzHc1SdJtMshlmfUsno3vAL4ZeHmSn7zRJn1qL/joySQHk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ofVV95nb1ojtPktcB39UtfrCqnhxlP6PUXbrdzeKb/omqenrELS3JcJekBnmfuyQ1yHCXpAYZ7pLUIMNdkhpkuEtSg/4fZamgIRhtg7UAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "pd.Series(sca_counts).sort_index().plot.bar()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "583312cf-a973-4671-9ba8-85fe10cb9e00", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(('alchemy', , 'abcde', 'abcde', False),\n", + " -6776.263168839725)" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_a, score_a = polybius_break(sca, column_labels='abcde', row_labels='abcde',\n", + " fitness=Ptrigrams)\n", + "key_a, score_a" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "4262216b-efed-491e-ade1-d7e8dffe4454", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'wemounhtbeattacbehkessayebdhhendntbeunherizdnycoheomandkayesentdnfungkaditopeopieattbeuseklasszdtkdybtbavesidppehpastuslutiucgdizbarrzanhdbahaireahzmdyurehouttbattbezkdybttrztocokkundcatetbdswaztbeconspdraczbahavodhehhetectdonmoroveracenturzsotbezwereunidgeiztokagetbekdstageomsenhdnykessayesexpidcdtizahhressehtooneanotberdtdsaiwazslestnottokageidngsletweenkeklersomanetworganhaweiibdhhenkessayednfungkadiavodhstbatrdsgespecdaiizdmdtdswdheizhdstrdlutehlzoneomtbelotnetworgsidgetbdsonedwastoomocussehontbehecrzptatmdrstanhwasntreahdnywbatdtsadhuntdidmounhbernakestardnylacgatkeattbeenhperbapswesbouihbaveaireahzreaidsehtbattrdndtzcouihlednvoivehlutdtneveroccurrehtoketbatbernakewasanztbdnyotbertbanacodncdhencetbemactsbescbaridesndecesbouihbaveidtuptbeidybtsontbehasbloarhtbouybanhdakworrdehtbatbarrzhdhntradsedtperbapsbedsaireahzsbahowdnyberanhhdhntidgetosazsooutomiozaitzlutbehdhntteiiketbatanhsokebowdtbdngbewouihdtbdngdtskoreidgeiztbatsbeslezonhsuspdcdondnbdskdnhsbebaspiazehandkportantroiednbdsnetworgmormourteenzearsanhtbemacttbatsbekdybtleahoulieayentwdiileareailiowtbatwaslahlutdtwasnttbeworstomdttbehetaditrdndtzydvesontbeconspdraczsrecentactdvdtdesdstruizmrdybtendnywbatcouihtbezwantattbebeartomtbepanhekdcresponseyroupssureiztbezcantbaveleenresponsdliemortbeoutlreaganhwbatweretbezhodnyatcopdhesperateizwanttotagetbdstobarrztotaigtobdkaloutdtluttbemdnaiparayrapbstoppehkednkztracgswbzoneartbhoestrdndtztbdngdkdybtfodntbekwbatbavedsadhorhonetbatwouihkagetbektbdngdcouihleatradtoranhwdiitbatkagebarrzhdstrustketoodknotsuredcantagetbatrdsgdkdybtbavetomdndsbtbdskdssdonaione'" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "word_a, wrap_a, col_a, row_a, col_first_a = key_a\n", + "polybius_decipher(sca, keyword=word_a, column_order=col_a, row_order=row_a,\n", + " column_first=col_first_a, wrap_alphabet=wrap_a)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "bbe56403-8038-4659-9f3d-7056ef60e665", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'xefpvoduheauuachednettagehiddeoiouhevodesmziogcpdepfaoinageteouiokvolnaimupqepqmeauuhevtenbattziunighuhawetmiqqedqatuvtbvumvclimzhasszaodihadamseadzfigvsedpvuuhauuheznighuuszupcpnnvoicaueuhitxazuhecpotqisaczhadawpideddeuecuipofpspwesaceouvsztpuhezxesevomilemzupnaleuhenitualepfteodiognettageteyqmiciumzaddsetteduppoeaopuhesiuitamxaztbetuopuupnalemioltbeuxeeonenbestpfaoeuxpslaodaxemmhiddeonettageiokvolnaimawpidtuhausitletqeciammzifiuitxidemzditusibvuedbzpoepfuhebpuoeuxpsltmileuhitpoeixatuppfpcvttedpouhedecszquaufistuaodxatouseadiogxhauiutaidvouimifpvodhesoanetuasiogbaclauneauuheeodqeshaqtxethpvmdhaweamseadzseamiteduhauusioiuzcpvmdbeiowpmwedbvuiuoewespccvssedupneuhauhesoanexataozuhiogpuhesuhaoacpiocideoceuhefacuthetchasmietoiecethpvmdhawemiuvquhemighutpouhedathbpasduhpvghaodianxpssieduhauhasszdidousaiteiuqeshaqtheitamseadzthadpxioghesaoddidoumileuptaztppvupfmpzamuzbvuhedidouuemmneuhauaodtpnehpxiuhiolhexpvmdiuhioliutnpsemilemzuhauthetbezpodtvtqicipoiohitniodthehatqmazedaoinqpsuaouspmeiohitoeuxpslfpsfpvsueeozeastaoduhefacuuhauthenighubeadpvbmeageouximmbeaseambmpxuhauxatbadbvuiuxatouuhexpstupfiuuhedeuaimusioiuzgiwetpouhecpotqisacztseceouacuiwiuietitusvmzfsighueoiogxhaucpvmduhezxaouauuheheasupfuheqaodenicsetqpotegspvqttvsemzuhezcaouhawebeeosetqpotibmefpsuhepvubsealaodxhauxeseuhezdpiogaucpqidetqesauemzxaouupualeuhituphasszupuamluphinabpvuiubvuuhefioamqasagsaqhtupqqedneionzusacltxhzpoeasuhdpetusioiuzuhiolinighukpiouhenxhauhaweitaidpsdpoeuhauxpvmdnaleuhenuhiolicpvmdbeausaiupsaodximmuhaunalehasszditusvtuneuppinoputvseicaoualeuhausitlinighuhaweupfioithuhitnittipoampoe'" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "xca = polybius_decipher(sca, keyword='a', column_order=col_a, row_order=row_a,\n", + " column_first=col_first_a, wrap_alphabet=wrap_a)\n", + "xca" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "81c5bc01-b60b-4d26-9f19-231854f4f6de", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abcdefghiklmnopqrstuvwxyzj'" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "word_a, _ = monoalphabetic_sa_break(xca)\n", + "word_a" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "7aa6dff2-f12c-4212-83df-3a9bb7b76334", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'wefoundtheattachedmessagehiddenintheunderlyingcodeofanimagesentinjunkmailtopeopleattheusembassyitmighthaveslippedpastusbutluckilyharryandihadalreadyfiguredoutthattheymighttrytocommunicatethiswaytheconspiracyhadavoideddetectionforoveracenturysotheywereunlikelytomakethemistakeofsendingmessagesexplicitlyaddressedtooneanotheritisalwaysbestnottomakelinksbetweenmembersofanetworkandawellhiddenmessageinjunkmailavoidsthatriskespeciallyifitiswidelydistributedbyoneofthebotnetworkslikethisoneiwastoofocussedonthedecryptatfirstandwasntreadingwhatitsaiduntilifoundhernamestaringbackatmeattheendperhapsweshouldhavealreadyrealisedthattrinitycouldbeinvolvedbutitneveroccurredtomethathernamewasanythingotherthanacoincidencethefactshescharliesnieceshouldhavelitupthelightsonthedashboardthoughandiamworriedthatharrydidntraiseitperhapsheisalreadyshadowingheranddidntliketosaysooutofloyaltybuthedidnttellmethatandsomehowithinkhewouldithinkitsmorelikelythatshesbeyondsuspicioninhismindshehasplayedanimportantroleinhisnetworkforfourteenyearsandthefactthatshemightbeadoubleagentwillbearealblowthatwasbadbutitwasnttheworstofitthedetailtrinitygivesontheconspiracysrecentactivitiesistrulyfrighteningwhatcouldtheywantattheheartofthepandemicresponsegroupssurelytheycanthavebeenresponsiblefortheoutbreakandwhatweretheydoingatcopidesperatelywanttotakethistoharrytotalktohimaboutitbutthefinalparagraphstoppedmeinmytrackswhyonearthdoestrinitythinkimightjointhemwhathaveisaidordonethatwouldmakethemthinkicouldbeatraitorandwillthatmakeharrydistrustmetooimnotsureicantakethatriskimighthavetofinishthismissionalone'" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pa = keyword_decipher(xca, word_a)\n", + "pa" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "c7f2e770-8062-4d18-b90a-cb2e410ef88c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "we found the attached message hidden in the underlying code of an image sent in junkmail to people\n", + "at the us embassy it might have slipped past us but luckily harry and i had already figured out that\n", + "they might try to communicate this way the conspiracy had avoided detection for over a century so\n", + "they were unlikely to make the mistake of sending messages explicitly addressed to one another it is\n", + "always best not to make links between members of a network and a well hidden message in junkmail\n", + "avoids that risk especially if it is widely distributed by one of the bot networks like this one i\n", + "was too focussed on the decrypt at first and wasnt reading what it said until i found her name\n", + "staring back at meat the end perhaps we should have already realised that trinity could be involved\n", + "but it never occurred to me that her name was anything other than a coincidence the fact shes\n", + "charlies niece should have lit up the lights on the dashboard though and i am worried that harry\n", + "didnt raise it perhaps he is already shadowing her and didnt like to say so out of loyalty but he\n", + "didnt tell me that and somehow i think he would i think its more likely that shes beyond suspicion\n", + "in his mind she has played an important role in his network for fourteen years and the fact that she\n", + "might be a double agent will be a real blow that was bad but it wasnt the worst of it the detail\n", + "trinity gives on the conspiracy s recent activities is truly frightening what could they want at the\n", + "heart of the pandemic response groups surely they cant have been responsible for the outbreak and\n", + "what were they doing at copi desperately want to take this to harry to talk to him about it but the\n", + "final paragraph stopped me in my tracks why on earth does trinity think i might join them what have\n", + "i said or done that would make them think i could be a traitor and will that make harry distrust me\n", + "too im not sure i can take that risk i might have to finish this mission alone\n" + ] + } + ], + "source": [ + "print(prettify(pa))" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "6cecddd9", + "metadata": { + "Collapsed": "false" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "1953" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open(plaintext_a_filename, 'w').write(prettify(pa))" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "07c92adb-74e2-476e-adff-887c0145617d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'10101 11000'" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cb[:11]" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "832dc153-c9e3-4134-9425-8014847c3870", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "21" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int('10101', 2)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "d7002750-66fd-4435-8ee8-023ae8376f33", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9865" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "scb = cat(c for c in cb if c in '01')\n", + "len(scb)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "f3c2587e-7b76-49fb-ba60-ed3efc148c85", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(0, 25)" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ncb = [int(g, 2) for g in cb.split()]\n", + "min(ncb), max(ncb)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "bf189676-3c25-420d-9330-b77cc57c7a82", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'vyietbcbuwabmfbeslwnqafcylayovkbuxrhcwalhlpvknvmpbjszmxrbeonvwwhlznzkgortuilzxvvawmgvvlogumljprqzfmvvvvzqnjxvkbmgyiezrqmvizqlyvkqimewbedramgzrbvvzmniweotlbjigqhlteljmayovbblhcovzlbaggxerktlmfxhbmfxdwsnmfxjkrvmsgwwebnltkmygbkpfzxqgepzbudxprtwaamptzvrlkclfcekxqwvacqmctctbckntelrubaiimcikymzwaabraraomxlarzqehpdfdrzmfxcifbxgzybrmgkhebuatqiciavxbpvcfmwravkeqlglkwruucwdwemhnxiigqoclrbgpxfxrzgwyehmmevfcgklrkbqbfvzidggxcalxpmympwockfnfizctelgpxmmymevxuvfuzqmrxvajmgmpyiimtlxkebzdmyjkvmgrbjbfigbxeovvxckjqaeagmvpnteubkpgpxbbimpbxykfnfmgghikvdbjlvziigrlrvqxhjbkqpqtllkprgtjlfprticwlagwblyztgztrxtwcobtbeohawgkvkgivaxjagwtlndjrzhdhkprzzmovzauxlmjbuimftuzrutggvlomrmguwhzkcttpjpbjxnmjmkcgfbnjecmfnhtewwvtvdxphewhzijteaswkrarbrdxlmkprkhlgvkgqhllnmziwcpzbuahkxfngpxuhitqaeykxmfbvmfgiaqxqtelfutjevagamymvajqejllzrtrntpwsnblmymzmwgndbrzfmgkprlhugjqqmbftmmabaywkprktnttqggblxvlgwpmkbwabacufafqgtxjbvotrbfvvvmmhlzbzzygzanbbmgkpnbbquvqaoksgwzbumfxrzpptchcwtgwgozavwgfximnbzaahquiwfhgmqbaymrafqzlfvvguxygkbuimravknaxutjzrotpwvlnaempgzvwkgmpjhbaykignalgzemqpbquvagizcgkrblbcmfzhvbrteltiocavzntfmlkcatbkbkmqzxqhlzpmlqavpnamctdanteyviwfamfxlsgztuezvtbaphloubacirxrzluxcmsbucazvqimravtvoarafcfmtlwkzlqgemfebzdmnkeuimravgzmtlbrufwtlzignbfwlvtsnhpmyigjnrbyiimickjwaiejrtprkdcwrvqiejmymzicmkzbruldkfugpxdhlvqimgheiekagoverzxqazxcmwmnkbbutqlfceqxygupndxzxvvfmvskvlnbmfxgiesbyljqtvxbtkmnummfrsranpxkpnbmfxbmllhandmabluximczhnxitlmgakpxgmwggtifmcmwzmfbxyfwqallravuocmebmmabacmrtrvmqavqfehpdzvtebrazvbemfbesjmfgzybamxbmfbnsxdnibumkqmvxfigbbgtnvmmozavbmfxyynalmheifqvygxmgipyrnprbackfzawmhhuqrigbavzgmtkpfzxwnrpyigexykvlbqgemymomlrprggwfydvahzxrarbuikpruwragmmwqalhsmdqtpmzxkwpwgtbekrpxpgfbgwmcecpvubftmmomxlvrzegblzfcgahkxsipszphlvqkacvbanvwgtdebvwckzvtqyuxjpbcebclagbkwmfzrkksbkprzwgkvkgtrgyjpretqpfzxqgepzbuclravvvulskvaumpmnclfmxravvrmwdhiarkkcvpbumwgkvkgiinkfippbqkzaxgusmkprwketeqfimghepnagcovzfpbcwrengyphdbuimzxwwemhprfcnvwgpfcylgruvebzdggxnbzbrbkpvvdgmzanzbqdnwebartbqaormnitbdblzeqrkxrkzvvbr'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tcb = cat(unpos(n) for n in ncb)\n", + "tcb" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "59f072b0-f8ca-4f08-922d-cfb5dfc68fe4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'beuxmwnprjiztavlsfgkqdyhco'" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "word_b, score_b = monoalphabetic_sa_break(tcb)\n", + "word_b" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "16210c33-3bcb-43c8-9189-d82eea7cf53b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "trinity \n", + "\n", + "charlieidontthinkyoushouldhavecometolondonwecantriskmeetingandyourarrivalhasbeennoticedbybossheighteningsuspicionharrysteamisactivelyinvestigatingourorganisationandwehavetodoeverythingwecantoputthemoffthescentunfortunatelyimworkingwithveryconstrainedresourcesdespiteallourpandemicpreparationsithasbeenhardworkoverthelasteighteenmonthsasplannedweusedthecrisistoembedmoreoperativesattheheartofgovernmentdecisionmakingunderthecoverofsageandtheothernewcommitteeswenowhaveanetworkofscientistsandengineersinwhitehallwiththedirectearofseniorcivilservantsandpoliticianstheyalsohelpedustoinfiltratecopgivingusdirectaccesstoanumberofothergovernmentsthathadremainedbeyondourreachwhilewewerenotabletofullydeliveronourplansforthateventtheconnectionswemadewithsomeoftheworldslargestcompaniesandsmalleststateswillsurelypayoffinthemediumtermonthedownsideihaventhadthecapacityineedtoworkonthebossinvestigationintoourorganisationthatisbeingrunfromthearchaeologydivisionhereatgchqihadhopedthatassignmentmeantthatthecasewasregardedaslowprioritybutharryassignedhisbestagentjodietorunitandgaveheralmostunlimitedresourcesshehasteamsallacrosstheuktrawlingthroughthepapersweleftbehindatthelighthouseandtryingtoworkoutwhattheymeaniamsoangryatmyselfforthatbutihavepersonallycheckedandallthemajoritemsfromthefoundationarchivewereshippedouttomassourieandhavebeensecuredattheparkiassignedateamtomakesurethatthekeydocumentswereproperlyencryptedincasejodiesteamfindsthembutgiventhetalentsheisworkingwithinowthinkwemightneedtotakefurtherstepsandiplantovisitthehqassoonasicangetawaywhetherornotjodieandherteamworkoutwhatwearedoingthebestwaytomakesurethatharrydoesnotfindoutmightbetoconvincehernottotellhimihavebeencarryingoutsomebackgroundchecksandiamwonderingifweshouldjusttrytorecruitherdirectlyifshewasworkingwithusthenimsureshewouldseetheneedforsecrecythedirectapproachisriskybuttheorganisationhasnevershiedawayfromthatbeforeoryouandiwouldntbeworkingforitithinkitisariskworthtakingyourlovingniecetrinity\n" + ] + } + ], + "source": [ + "word_b, score_b = vigenere_frequency_break(tcb, fitness=Ptrigrams)\n", + "print(word_b, '\\n')\n", + "pb = vigenere_decipher(tcb, word_b)\n", + "print(pb)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "fe094361-7c85-40d9-952e-0c84abbcf903", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "charlie i dont think you should have come to london we cant risk meeting and your arrival has been\n", + "noticed by boss heightening suspicion harry steam is actively investigating our organisation and we\n", + "have to do everything we can to put them off the scent unfortunately im working with very\n", + "constrained resources despite all our pandemic preparations it has been hard work over the last\n", + "eighteen months as planned we used the crisis to embed more operatives at the heart of government\n", + "decisionmaking under the cover of sage and the other new committees we now have a network of\n", + "scientists and engineers in whitehall with the direct ear of senior civil servants and politicians\n", + "they also helped us to infiltrate cop giving us direct access to a number of other governments that\n", + "had remained beyond our reach while we were notable to fully deliver on our plans for that event the\n", + "connections we made with some of the worlds largest companies and smallest states will surely payoff\n", + "in the medium term on the downside i havent had the capacity i need to work on the boss\n", + "investigation into our organisation that is being run from the archaeology division here at gchq i\n", + "had hoped that assignment meant that the case was regarded as low priority but harry assigned his\n", + "best agent jodie to run it and gave her almost unlimited resources she has teams all across the uk\n", + "trawling through the papers we left behind at the lighthouse and trying to workout what they mean i\n", + "am so angry at myself for that but i have personally checked and all the major items from the\n", + "foundation archive were shipped out to mass our ie and have been secured at the park i assigned a\n", + "team to make sure that the key documents were properly encrypted in case jodie steam finds them but\n", + "given the talent she is working with i now think we might need to take further steps and i plan to\n", + "visit the hq as soon as i can getaway whether or not jodie and her teamwork out what we are doing\n", + "the best way to make sure that harry does not find out might be to convince her not to tell him i\n", + "have been carrying out some background checks and i am wondering if we should just try to recruit\n", + "her directly if she was working with us then im sure she would see the need for secrecy the direct\n", + "approach is risky but the organisation has never shied away from that before or you and i wouldnt be\n", + "working for it i think it is a risk worth taking your loving niece trinity\n" + ] + } + ], + "source": [ + "print(prettify(pb))" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "id": "d12a663c", + "metadata": { + "Collapsed": "false" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "2420" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open(plaintext_b_filename, 'w').write(prettify(pb))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "504ec2e2", + "metadata": { + "Collapsed": "false" + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "jupytext": { + "formats": "ipynb,md" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.8.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/2021/2021-challenge7.md b/2021/2021-challenge7.md new file mode 100644 index 0000000..56140fa --- /dev/null +++ b/2021/2021-challenge7.md @@ -0,0 +1,144 @@ +--- +jupyter: + jupytext: + formats: ipynb,md + text_representation: + extension: .md + format_name: markdown + format_version: '1.3' + jupytext_version: 1.11.1 + kernelspec: + display_name: Python 3 (ipykernel) + language: python + name: python3 +--- + +```python Collapsed="false" +from szyfrow.caesar import * +from szyfrow.affine import * +from szyfrow.keyword_cipher import * +from szyfrow.column_transposition import * +from szyfrow.vigenere import * +from szyfrow.polybius import * +from szyfrow.support.text_prettify import * + +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +import collections +%matplotlib inline +``` + +```python Collapsed="false" +challenge_number = 7 +plaintext_a_filename = f'plaintext.{challenge_number}a.txt' +plaintext_b_filename = f'plaintext.{challenge_number}b.txt' +ciphertext_a_filename = f'ciphertext.{challenge_number}a.txt' +ciphertext_b_filename = f'ciphertext.{challenge_number}b.txt' +``` + +```python Collapsed="false" +nca = open(ciphertext_a_filename).read() +cb = open(ciphertext_b_filename).read() + +numtrans = ''.maketrans('12345', 'abcde') +ca = nca.translate(numtrans) + +sca = sanitise(ca) +rsca = cat(reversed(sca)) +scb = sanitise(cb) +rscb = cat(reversed(scb)) +``` + +```python +sca_counts = collections.Counter(sca) +sca_counts +``` + +```python +pd.Series(sca_counts).sort_index().plot.bar() +``` + +```python +key_a, score_a = polybius_break(sca, column_labels='abcde', row_labels='abcde', + fitness=Ptrigrams) +key_a, score_a +``` + +```python +word_a, wrap_a, col_a, row_a, col_first_a = key_a +polybius_decipher(sca, keyword=word_a, column_order=col_a, row_order=row_a, + column_first=col_first_a, wrap_alphabet=wrap_a) +``` + +```python +xca = polybius_decipher(sca, keyword='a', column_order=col_a, row_order=row_a, + column_first=col_first_a, wrap_alphabet=wrap_a) +xca +``` + +```python +word_a, _ = monoalphabetic_sa_break(xca) +word_a +``` + +```python +pa = keyword_decipher(xca, word_a) +pa +``` + +```python +print(prettify(pa)) +``` + +```python Collapsed="false" +open(plaintext_a_filename, 'w').write(prettify(pa)) +``` + +```python +cb[:11] +``` + +```python +int('10101', 2) +``` + +```python +scb = cat(c for c in cb if c in '01') +len(scb) +``` + +```python +ncb = [int(g, 2) for g in cb.split()] +min(ncb), max(ncb) +``` + +```python +tcb = cat(unpos(n) for n in ncb) +tcb +``` + +```python +word_b, score_b = monoalphabetic_sa_break(tcb) +word_b +``` + +```python +word_b, score_b = vigenere_frequency_break(tcb, fitness=Ptrigrams) +print(word_b, '\n') +pb = vigenere_decipher(tcb, word_b) +print(pb) +``` + +```python +print(prettify(pb)) +``` + +```python Collapsed="false" +open(plaintext_b_filename, 'w').write(prettify(pb)) +``` + +```python Collapsed="false" + +``` diff --git a/2021/ciphertext.7a.txt b/2021/ciphertext.7a.txt new file mode 100644 index 0000000..596320b --- /dev/null +++ b/2021/ciphertext.7a.txt @@ -0,0 +1 @@ +53152 13551 34144 52315 11454 51113 23151 43315 44441 12215 23241 41415 34243 44523 15513 41415 43325 52434 22133 51415 35211 13424 33112 21544 15344 52434 25513 43133 11243 24535 41153 54132 15114 54523 15514 41533 12114 44455 24453 32422 23452 31152 15443 22441 41151 44111 44455 14412 51453 25113 31243 25523 11434 35511 34142 42311 14113 24315 11145 52124 22514 31514 35514 54523 11454 52315 55332 42223 45454 35545 35133 53333 51342 41311 45154 52324 44531 15545 23151 33534 44412 44311 13552 31114 11523 52414 15141 41545 15134 52435 34213 54335 52154 31113 15344 55143 55443 54523 15555 31543 15513 43224 31153 25545 35331 13115 45231 53324 44451 13115 35214 41534 14243 42233 15444 41122 15441 55441 32241 32445 32551 11414 43154 44415 14453 53534 15113 43545 23154 32445 24441 13253 11554 41215 44453 43545 45353 31131 15322 43431 44121 54553 15153 43315 33121 54344 35211 13415 45533 54331 11341 41153 15323 22324 14141 53433 15444 41122 15243 42551 34313 31124 32115 23524 14444 52311 45432 44431 15444 11513 24113 23255 24212 44524 44532 41415 32551 42444 45432 41251 45151 41255 35341 53521 45231 51235 45341 54553 35433 14432 24311 54523 24443 53415 24531 14445 35352 13513 51444 41514 35344 52315 14151 34355 41451 14521 24434 44511 34145 31144 34454 31511 14243 42253 23114 52445 44112 41451 34452 43224 21355 13414 23154 33411 33154 44511 43243 42212 11133 11145 33151 14545 23151 53414 41154 32311 41445 31544 23355 13214 23115 21511 32431 51114 55431 51132 24441 51445 23114 54543 24342 44555 13355 13214 12152 43452 35325 21514 12514 52445 34155 21543 35131 35143 43151 44535 33154 52311 45231 54334 11331 55311 44113 45545 23243 42235 45231 54345 23113 41113 35243 41324 14153 41315 45231 52111 13454 42315 44132 31143 32241 54434 24151 31544 23355 13214 23115 21532 24455 14145 23153 22422 23454 43534 45231 51411 44231 23511 43144 52335 51222 31134 14241 13353 35434 32415 14452 31145 23114 34355 14241 43445 43112 44415 24454 11543 23114 14423 15244 41132 43151 11455 44231 11435 53243 42223 15431 13414 14241 43445 32243 11545 35441 15544 35355 14535 21323 55511 32455 51251 45231 51424 14344 54515 32323 31545 23114 51134 14443 53315 23355 32445 23243 43123 15533 55132 14244 52324 34312 44544 33354 31532 24311 53255 45231 14544 23154 41215 55353 41444 51444 12413 24353 42434 23244 43324 34144 42315 23114 44132 11551 51411 34243 34135 43451 13445 43353 21524 34232 44434 15455 33543 31213 54321 35514 34515 15345 51511 43441 13414 45231 52111 13454 52311 45442 31533 24222 34512 15111 43551 12321 51122 15344 55324 32321 21511 43151 13212 32355 34523 11455 31144 12111 41251 45244 55311 44344 54523 15533 54344 45352 12445 45231 51415 45112 43245 43243 42445 55222 45215 44353 44523 15133 53444 41244 31113 55444 31513 15344 51113 45245 22445 24154 42444 45435 13255 21432 42223 45153 42434 22532 31145 13355 13214 45231 55553 11344 51145 45231 52315 11434 53521 45231 54111 34141 53324 13431 54441 35344 41522 43355 14144 44514 31532 55452 31555 13113 44523 11521 51215 15344 31544 41353 44424 12321 52135 43452 31535 51451 24315 11311 13414 53231 14553 15431 54523 15551 43524 34221 14513 35412 41415 44411 54311 45153 25553 11344 54535 45113 11545 23244 44535 23114 34355 45354 51132 31453 52324 33111 23551 45244 51251 45452 31521 24341 13241 11431 12243 11412 34445 35414 11514 33152 43433 55454 31113 31445 32355 35341 51143 45231 43515 44454 32434 24455 54523 24343 12433 24222 34525 35243 44523 15335 32311 45231 15215 24441 12414 35431 43534 15452 31145 53355 13214 33113 11545 23153 34523 24343 12413 35513 21412 15114 54311 24453 54311 34145 32432 32452 31145 33113 11523 11434 35514 24444 54351 44453 31545 35352 43334 35454 45143 15241 31134 45113 11545 23114 54324 44312 43324 22234 52311 52154 53521 24342 44423 45232 44433 24444 42435 34113 23534 15 diff --git a/2021/ciphertext.7b.txt b/2021/ciphertext.7b.txt new file mode 100644 index 0000000..f9291ae --- /dev/null +++ b/2021/ciphertext.7b.txt @@ -0,0 +1 @@ +10101 11000 01000 00100 10011 00001 00010 00001 10100 10110 00000 00001 01100 00101 00001 00100 10010 01011 10110 01101 10000 00000 00101 00010 11000 01011 00000 11000 01110 10101 01010 00001 10100 10111 10001 00111 00010 10110 00000 01011 00111 01011 01111 10101 01010 01101 10101 01100 01111 00001 01001 10010 11001 01100 10111 10001 00001 00100 01110 01101 10101 10110 10110 00111 01011 11001 01101 11001 01010 00110 01110 10001 10011 10100 01000 01011 11001 10111 10101 10101 00000 10110 01100 00110 10101 10101 01011 01110 00110 10100 01100 01011 01001 01111 10001 10000 11001 00101 01100 10101 10101 10101 10101 11001 10000 01101 01001 10111 10101 01010 00001 01100 00110 11000 01000 00100 11001 10001 10000 01100 10101 01000 11001 10000 01011 11000 10101 01010 10000 01000 01100 00100 10110 00001 00100 00011 10001 00000 01100 00110 11001 10001 00001 10101 10101 11001 01100 01101 01000 10110 00100 01110 10011 01011 00001 01001 01000 00110 10000 00111 01011 10011 00100 01011 01001 01100 00000 11000 01110 10101 00001 00001 01011 00111 00010 01110 10101 11001 01011 00001 00000 00110 00110 10111 00100 10001 01010 10011 01011 01100 00101 10111 00111 00001 01100 00101 10111 00011 10110 10010 01101 01100 00101 10111 01001 01010 10001 10101 01100 10010 00110 10110 10110 00100 00001 01101 01011 10011 01010 01100 11000 00110 00001 01010 01111 00101 11001 10111 10000 00110 00100 01111 11001 00001 10100 00011 10111 01111 10001 10011 10110 00000 00000 01100 01111 10011 11001 10101 10001 01011 01010 00010 01011 00101 00010 00100 01010 10111 10000 10110 10101 00000 00010 10000 01100 00010 10011 00010 10011 00001 00010 01010 01101 10011 00100 01011 10001 10100 00001 00000 01000 01000 01100 00010 01000 01010 11000 01100 11001 10110 00000 00000 00001 10001 00000 10001 00000 01110 01100 10111 01011 00000 10001 11001 10000 00100 00111 01111 00011 00101 00011 10001 11001 01100 00101 10111 00010 01000 00101 00001 10111 00110 11001 11000 00001 10001 01100 00110 01010 00111 00100 00001 10100 00000 10011 10000 01000 00010 01000 00000 10101 10111 00001 01111 10101 00010 00101 01100 10110 10001 00000 10101 01010 00100 10000 01011 00110 01011 01010 10110 10001 10100 10100 00010 10110 00011 10110 00100 01100 00111 01101 10111 01000 01000 00110 10000 01110 00010 01011 10001 00001 00110 01111 10111 00101 10111 10001 11001 00110 10110 11000 00100 00111 01100 01100 00100 10101 00101 00010 00110 01010 01011 10001 01010 00001 10000 00001 00101 10101 11001 01000 00011 00110 00110 10111 00010 00000 01011 10111 01111 01100 11000 01100 01111 10110 01110 00010 01010 00101 01101 00101 01000 11001 00010 10011 00100 01011 00110 01111 10111 01100 01100 11000 01100 00100 10101 10111 10100 10101 00101 10100 11001 10000 01100 10001 10111 10101 00000 01001 01100 00110 01100 01111 11000 01000 01000 01100 10011 01011 10111 01010 00100 00001 11001 00011 01100 11000 01001 01010 10101 01100 00110 10001 00001 01001 00001 00101 01000 00110 00001 10111 00100 01110 10101 10101 10111 00010 01010 01001 10000 00000 00100 00000 00110 01100 10101 01111 01101 10011 00100 10100 00001 01010 01111 00110 01111 10111 00001 00001 01000 01100 01111 00001 10111 11000 01010 00101 01101 00101 01100 00110 00110 00111 01000 01010 10101 00011 00001 01001 01011 10101 11001 01000 01000 00110 10001 01011 10001 10101 10000 10111 00111 01001 00001 01010 10000 01111 10000 10011 01011 01011 01010 01111 10001 00110 10011 01001 01011 00101 01111 10001 10011 01000 00010 10110 01011 00000 00110 10110 00001 01011 11000 11001 10011 00110 11001 10011 10001 10111 10011 10110 00010 01110 00001 10011 00001 00100 01110 00111 00000 10110 00110 01010 10101 01010 00110 01000 10101 00000 10111 01001 00000 00110 10110 10011 01011 01101 00011 01001 10001 11001 00111 00011 00111 01010 01111 10001 11001 11001 01100 01110 10101 11001 00000 10100 10111 01011 01100 01001 00001 10100 01000 01100 00101 10011 10100 11001 10001 10100 10011 00110 00110 10101 01011 01110 01100 10001 01100 00110 10100 10110 00111 11001 01010 00010 10011 10011 01111 01001 01111 00001 01001 10111 01101 01100 01001 01100 01010 00010 00110 00101 00001 01101 01001 00100 00010 01100 00101 01101 00111 10011 00100 10110 10110 10101 10011 10101 00011 10111 01111 00111 00100 10110 00111 11001 01000 01001 10011 00100 00000 10010 10110 01010 10001 00000 10001 00001 10001 00011 10111 01011 01100 01010 01111 10001 01010 00111 01011 00110 10101 01010 00110 10000 00111 01011 01011 01101 01100 11001 01000 10110 00010 01111 11001 00001 10100 00000 00111 01010 10111 00101 01101 00110 01111 10111 10100 00111 01000 10011 10000 00000 00100 11000 01010 10111 01100 00101 00001 10101 01100 00101 00110 01000 00000 10000 10111 10000 10011 00100 01011 00101 10100 10011 01001 00100 10101 00000 00110 00000 01100 11000 01100 10101 00000 01001 10000 00100 01001 01011 01011 11001 10001 10011 10001 01101 10011 01111 10110 10010 01101 00001 01011 01100 11000 01100 11001 01100 10110 00110 01101 00011 00001 10001 11001 00101 01100 00110 01010 01111 10001 01011 00111 10100 00110 01001 10000 10000 01100 00001 00101 10011 01100 01100 00000 00001 00000 11000 10110 01010 01111 10001 01010 10011 01101 10011 10011 10000 00110 00110 00001 01011 10111 10101 01011 00110 10110 01111 01100 01010 00001 10110 00000 00001 00000 00010 10100 00101 00000 00101 10000 00110 10011 10111 01001 00001 10101 01110 10011 10001 00001 00101 10101 10101 10101 01100 01100 00111 01011 11001 00001 11001 11001 11000 00110 11001 00000 01101 00001 00001 01100 00110 01010 01111 01101 00001 00001 10000 10100 10101 10000 00000 01110 01010 10010 00110 10110 11001 00001 10100 01100 00101 10111 10001 11001 01111 01111 10011 00010 00111 00010 10110 10011 00110 10110 00110 01110 11001 00000 10101 10110 00110 00101 10111 01000 01100 01101 00001 11001 00000 00000 00111 10000 10100 01000 10110 00101 00111 00110 01100 10000 00001 00000 11000 01100 10001 00000 00101 10000 11001 01011 00101 10101 10101 00110 10100 10111 11000 00110 01010 00001 10100 01000 01100 10001 00000 10101 01010 01101 00000 10111 10100 10011 01001 11001 10001 01110 10011 01111 10110 10101 01011 01101 00000 00100 01100 01111 00110 11001 10101 10110 01010 00110 01100 01111 01001 00111 00001 00000 11000 01010 01000 00110 01101 00000 01011 00110 11001 00100 01100 10000 01111 00001 10000 10100 10101 00000 00110 01000 11001 00010 00110 01010 10001 00001 01011 00001 00010 01100 00101 11001 00111 10101 00001 10001 10011 00100 01011 10011 01000 01110 00010 00000 10101 11001 01101 10011 00101 01100 01011 01010 00010 00000 10011 00001 01010 00001 01010 01100 10000 11001 10111 10000 00111 01011 11001 01111 01100 01011 10000 00000 10101 01111 01101 00000 01100 00010 10011 00011 00000 01101 10011 00100 11000 10101 01000 10110 00101 00000 01100 00101 10111 01011 10010 00110 11001 10011 10100 00100 11001 10101 10011 00001 00000 01111 00111 01011 01110 10100 00001 00000 00010 01000 10001 10111 10001 11001 01011 10100 10111 00010 01100 10010 00001 10100 00010 00000 11001 10101 10000 01000 01100 10001 00000 10101 10011 10101 01110 00000 10001 00000 00101 00010 00101 01100 10011 01011 10110 01010 11001 01011 10000 00110 00100 01100 00101 00100 00001 11001 00011 01100 01101 01010 00100 10100 01000 01100 10001 00000 10101 00110 11001 01100 10011 01011 00001 10001 10100 00101 10110 10011 01011 11001 01000 00110 01101 00001 00101 10110 01011 10101 10011 10010 01101 00111 01111 01100 11000 01000 00110 01001 01101 10001 00001 11000 01000 01000 01100 01000 00010 01010 01001 10110 00000 01000 00100 01001 10001 10011 01111 10001 01010 00011 00010 10110 10001 10101 10000 01000 00100 01001 01100 11000 01100 11001 01000 00010 01100 01010 11001 00001 10001 10100 01011 00011 01010 00101 10100 00110 01111 10111 00011 00111 01011 10101 10000 01000 01100 00110 00111 00100 01000 00100 01010 00000 00110 01110 10101 00100 10001 11001 10111 10000 00000 11001 10111 00010 01100 10110 01100 01101 01010 00001 00001 10100 10011 10000 01011 00101 00010 00100 10000 10111 11000 00110 10100 01111 01101 00011 10111 11001 10111 10101 10101 00101 01100 10101 10010 01010 10101 01011 01101 00001 01100 00101 10111 00110 01000 00100 10010 00001 11000 01011 01001 10000 10011 10101 10111 00001 10011 01010 01100 01101 10100 01100 01100 00101 10001 10010 10001 00000 01101 01111 10111 01010 01111 01101 00001 01100 00101 10111 00001 01100 01011 01011 00111 00000 01101 00011 01100 00000 00001 01011 10100 10111 01000 01100 00010 11001 00111 01101 10111 01000 10011 01011 01100 00110 00000 01010 01111 10111 00110 01100 10110 00110 00110 10011 01000 00101 01100 00010 01100 10110 11001 01100 00101 00001 10111 11000 00101 10110 10000 00000 01011 01011 10001 00000 10101 10100 01110 00010 01100 00100 00001 01100 01100 00000 00001 00000 00010 01100 10001 10011 10001 10101 01100 10000 00000 10101 10000 00101 00100 00111 01111 00011 11001 10101 10011 00100 00001 10001 00000 11001 10101 00001 00100 01100 00101 00001 00100 10010 01001 01100 00101 00110 11001 11000 00001 00000 01100 10111 00001 01100 00101 00001 01101 10010 10111 00011 01101 01000 00001 10100 01100 01010 10000 01100 10101 10111 00101 01000 00110 00001 00001 00110 10011 01101 10101 01100 01100 01110 11001 00000 10101 00001 01100 00101 10111 11000 11000 01101 00000 01011 01100 00111 00100 01000 00101 10000 10101 11000 00110 10111 01100 00110 01000 01111 11000 10001 01101 01111 10001 00001 00000 00010 01010 00101 11001 00000 10110 01100 00111 00111 10100 10000 10001 01000 00110 00001 00000 10101 11001 00110 01100 10011 01010 01111 00101 11001 10111 10110 01101 10001 01111 11000 01000 00110 00100 10111 11000 01010 10101 01011 00001 10000 00110 00100 01100 11000 01100 01110 01100 01011 10001 01111 10001 00110 00110 10110 00101 11000 00011 10101 00000 00111 11001 10111 10001 00000 10001 00001 10100 01000 01010 01111 10001 10100 10110 10001 00000 00110 01100 01100 10110 10000 00000 01011 00111 10010 01100 00011 10000 10011 01111 01100 11001 10111 01010 10110 01111 10110 00110 10011 00001 00100 01010 10001 01111 10111 01111 00110 00101 00001 00110 10110 01100 00010 00100 00010 01111 10101 10100 00001 00101 10011 01100 01100 01110 01100 10111 01011 10101 10001 11001 00100 00110 00001 01011 11001 00101 00010 00110 00000 00111 01010 10111 10010 01000 01111 10010 11001 01111 00111 01011 10101 10000 01010 00000 00010 10101 00001 00000 01101 10101 10110 00110 10011 00011 00100 00001 10101 10110 00010 01010 11001 10101 10011 10000 11000 10100 10111 01001 01111 00001 00010 00100 00001 00010 01011 00000 00110 00001 01010 10110 01100 00101 11001 10001 01010 01010 10010 00001 01010 01111 10001 11001 10110 00110 01010 10101 01010 00110 10011 10001 00110 11000 01001 01111 10001 00100 10011 10000 01111 00101 11001 10111 10000 00110 00100 01111 11001 00001 10100 00010 01011 10001 00000 10101 10101 10101 10100 01011 10010 01010 10101 00000 10100 01100 01111 01100 01101 00010 01011 00101 01100 10111 10001 00000 10101 10101 10001 01100 10110 00011 00111 01000 00000 10001 01010 01010 00010 10101 01111 00001 10100 01100 10110 00110 01010 10101 01010 00110 01000 01000 01101 01010 00101 01000 01111 01111 00001 10000 01010 11001 00000 10111 00110 10100 10010 01100 01010 01111 10001 10110 01010 00100 10011 00100 10000 00101 01000 01100 00110 00111 00100 01111 01101 00000 00110 00010 01110 10101 11001 00101 01111 00001 00010 10110 10001 00100 01101 00110 11000 01111 00111 00011 00001 10100 01000 01100 11001 10111 10110 10110 00100 01100 00111 01111 10001 00101 00010 01101 10101 10110 00110 01111 00101 00010 11000 01011 00110 10001 10100 10101 00100 00001 11001 00011 00110 00110 10111 01101 00001 11001 00001 10001 00001 01010 01111 10101 10101 00011 00110 01100 11001 00000 01101 11001 00001 10000 00011 01101 10110 00100 00001 00000 10001 10011 00001 10000 00000 01110 10001 01100 01101 01000 10011 00001 00011 00001 01011 11001 00100 10000 10001 01010 10111 10001 01010 11001 10101 10101 00001 10001 diff --git a/2021/plaintext.7a.txt b/2021/plaintext.7a.txt new file mode 100644 index 0000000..1ff5e11 --- /dev/null +++ b/2021/plaintext.7a.txt @@ -0,0 +1,20 @@ +we found the attached message hidden in the underlying code of an image sent in junkmail to people +at the us embassy it might have slipped past us but luckily harry and i had already figured out that +they might try to communicate this way the conspiracy had avoided detection for over a century so +they were unlikely to make the mistake of sending messages explicitly addressed to one another it is +always best not to make links between members of a network and a well hidden message in junkmail +avoids that risk especially if it is widely distributed by one of the bot networks like this one i +was too focussed on the decrypt at first and wasnt reading what it said until i found her name +staring back at meat the end perhaps we should have already realised that trinity could be involved +but it never occurred to me that her name was anything other than a coincidence the fact shes +charlies niece should have lit up the lights on the dashboard though and i am worried that harry +didnt raise it perhaps he is already shadowing her and didnt like to say so out of loyalty but he +didnt tell me that and somehow i think he would i think its more likely that shes beyond suspicion +in his mind she has played an important role in his network for fourteen years and the fact that she +might be a double agent will be a real blow that was bad but it wasnt the worst of it the detail +trinity gives on the conspiracy s recent activities is truly frightening what could they want at the +heart of the pandemic response groups surely they cant have been responsible for the outbreak and +what were they doing at copi desperately want to take this to harry to talk to him about it but the +final paragraph stopped me in my tracks why on earth does trinity think i might join them what have +i said or done that would make them think i could be a traitor and will that make harry distrust me +too im not sure i can take that risk i might have to finish this mission alone \ No newline at end of file diff --git a/2021/plaintext.7b.txt b/2021/plaintext.7b.txt new file mode 100644 index 0000000..87ac7a9 --- /dev/null +++ b/2021/plaintext.7b.txt @@ -0,0 +1,25 @@ +charlie i dont think you should have come to london we cant risk meeting and your arrival has been +noticed by boss heightening suspicion harry steam is actively investigating our organisation and we +have to do everything we can to put them off the scent unfortunately im working with very +constrained resources despite all our pandemic preparations it has been hard work over the last +eighteen months as planned we used the crisis to embed more operatives at the heart of government +decisionmaking under the cover of sage and the other new committees we now have a network of +scientists and engineers in whitehall with the direct ear of senior civil servants and politicians +they also helped us to infiltrate cop giving us direct access to a number of other governments that +had remained beyond our reach while we were notable to fully deliver on our plans for that event the +connections we made with some of the worlds largest companies and smallest states will surely payoff +in the medium term on the downside i havent had the capacity i need to work on the boss +investigation into our organisation that is being run from the archaeology division here at gchq i +had hoped that assignment meant that the case was regarded as low priority but harry assigned his +best agent jodie to run it and gave her almost unlimited resources she has teams all across the uk +trawling through the papers we left behind at the lighthouse and trying to workout what they mean i +am so angry at myself for that but i have personally checked and all the major items from the +foundation archive were shipped out to mass our ie and have been secured at the park i assigned a +team to make sure that the key documents were properly encrypted in case jodie steam finds them but +given the talent she is working with i now think we might need to take further steps and i plan to +visit the hq as soon as i can getaway whether or not jodie and her teamwork out what we are doing +the best way to make sure that harry does not find out might be to convince her not to tell him i +have been carrying out some background checks and i am wondering if we should just try to recruit +her directly if she was working with us then im sure she would see the need for secrecy the direct +approach is risky but the organisation has never shied away from that before or you and i wouldnt be +working for it i think it is a risk worth taking your loving niece trinity \ No newline at end of file