From: Neil Smith Date: Thu, 19 Oct 2017 15:23:44 +0000 (+0100) Subject: Challenge 3a done X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=8543ce0d45e4046c2c056e395ddf91d3c8a35586;p=cipher-tools.git Challenge 3a done --- diff --git a/2017/2017-challenge3.ipynb b/2017/2017-challenge3.ipynb new file mode 100644 index 0000000..13159d2 --- /dev/null +++ b/2017/2017-challenge3.ipynb @@ -0,0 +1,1474 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "import os,sys,inspect, collections\n", + "currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\n", + "parentdir = os.path.dirname(currentdir)\n", + "sys.path.insert(0,parentdir) \n", + "\n", + "import matplotlib.pyplot as plt\n", + "%matplotlib inline\n", + "\n", + "from cipherbreak import *\n", + "\n", + "ca = open('3a.ciphertext').read()\n", + "cb = open('3b.ciphertext').read()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(24, -2521.8292883073464)" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_a, score = caesar_break(ca)\n", + "key_a, score" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "KETQEK,\n", + "I HBYOUBH AYKG KYTG ELYOH CBEH QYO AEIZ IR HBG BYAFIHED, ERZ UIVGR CBEH BEA BEFFGRGZ I HBIRW I IH CYODZ LG UYYZ HY CYTW HYUGHBGT.\n", + "\n", + "ORNYTHOREHGDQ IH AGGKA HBEH I EK RYH HBG YRDQ YRG HTQIRU HY NIRZ HBG LYYW. HBGTG IA E HBTIVIRU LDESW KETWGH EKYRU LILDIYFBIDGA NYT ERQHBIRU EA YDZ EA HBIA. IH IA VGTQ VEDOELDG ERZ IN HBG LYYW ZIAEFFGETA IRHY HBG ABEZYCQ CYTDZ YN FTIVEHG DILTETIGA CG KIUBH RYH AGG IH EUEIR NYT SGRHOTIGA AY IH IA TGEDDQ IKFYTHERH CG UGH HY IH NITAH.\n", + "\n", + "HESIHOA SDGETDQ CERHGZ HY KEWG IH ZINNISODH HY EAAGKLDG HBG GRHITG ZYSOKGRH, AY BG BEZ IH BIZZGR EH E ROKLGT YN AIHGA ETYORZ HBG ERSIGRH CYTDZ. HBG LTIHIAB DILTETQ ZGSIZGZ HY AGRZ AYKGYRG HY HTQ HY NIRZ EDD HBG FIGSGA. HBGIT GJFGTHA NIUOTGZ HBG SBEFHGTA CGTG DIWGDQ HY LG GRSTQFHGZ HYY AY, UIVGR KQ LESWUTYORZ, HBGQ EAWGZ KG HY UY. HBGQ CGTG TIUBH YN SYOTAG, HBG NITAH SBEFHGT CEA ZIAUOIAGZ OAIRU E SEGAET ABINH ERZ HBG AGSYRZ LQ E ASQHEDG SIFBGT, ERZ I EK LGUIRRIRU HY CYRZGT CBEH YHBGT SIFBGTA HESIHOA KIUBH SBEDDGRUG OA CIHB. EA NET EA CG WRYC HBG TYKERA CYODZ RYH BEVG BEZ HBEH KERQ HY SBYYAG NTYK. I AOFFYAG BG KIUBH BEVG WRYCR ELYOH AYKG NYTK YN HBG FYDQLIOA SIFBGT.\n", + "\n", + "HBG ZYSOKGRHA I BEVG NYORZ AY NET (HESIHOA DEAH HGAHEKGRH ERZ SBEFHGTA YRG ERZ HCY YN BIA BIZZGR LYYW) GESB UIVG E SDOG HY HBG DYSEHIYR YN HBG RGJH YRG, ERZ EA AYYR EA HBGQ DGH KG YOH YN BYAFIHED I FDER HY HTQ HY DYSEHG HBG HBITZ SBEFHGT, CBISB HESIHOA HGDDA OA IA BIZZGR YR HBG IADG YN HBYTRA. HBGTG ETG AGVGTED FDESGA IR HBG ERSIGRH CYTDZ HBEH HBIA KIUBH TGNGT HY, LOH I BEVG E FTGHHQ UYYZ IZGE YN CBGTG IH KIUBH LG.\n", + "\n", + "IN I HBIRW YN ERQHBIRU GDAG I CIDD UGH IH HY QYO, ERZ EA TGMOGAHGZ I CIDD SYFQ IR QYOT NTIGRZ BETTQ. I AOUUGAH CG HIUBHGR AGSOTIHQ E DIHHDG. KEQLG IN CG LDYSW YOT SIFBGT HGJHA DIWG HBG GJFGTHA IH CIDD FOH YNN SEAOED IRHGTSGFHA. HBG FGYFDG CG ETG OF EUEIRAH ETG ORDIWGDQ HY LG ZGHGTTGZ LQ KOSB, LOH CG ZYR'H CERH HY IRVIHG GJHTE IRHGTDYFGTA HY HBG FETHQ.\n", + "\n", + "LQ HBG CEQ, KQ NTIGRZ IR HBG AYOW HYDZ KG HBEH BG KGH YRG YN QYOT EUGRHA CBY CEA EAWIRU IN BG WRGC CBGTG I CEA, CBISB AGGKA E LIH YZZ UIVGR HBEH QYO WRYC I EK AHOSW BGTG. CEA HBEH POAH HY HBTYC YOT TIVEDA YNN HBG ASGRH?\n", + "\n", + "EDD HBG LGAH,\n", + "\n", + "PYZIG\n" + ] + } + ], + "source": [ + "print(caesar_decipher(ca, key_a))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "((7, 22, True), -2146.2748427553324)" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "(m_a, a_a, o_a), score = affine_break(ca)\n", + "(m_a, a_a, o_a), score" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "MARYAM,\n", + "I THOUGHT SOME MORE ABOUT WHAT YOU SAID IN THE HOSPITAL, AND GIVEN WHAT HAS HAPPENED I THINK I IT WOULD BE GOOD TO WORK TOGETHER.\n", + "\n", + "UNFORTUNATELY IT SEEMS THAT I AM NOT THE ONLY ONE TRYING TO FIND THE BOOK. THERE IS A THRIVING BLACK MARKET AMONG BIBLIOPHILES FOR ANYTHING AS OLD AS THIS. IT IS VERY VALUABLE AND IF THE BOOK DISAPPEARS INTO THE SHADOWY WORLD OF PRIVATE LIBRARIES WE MIGHT NOT SEE IT AGAIN FOR CENTURIES SO IT IS REALLY IMPORTANT WE GET TO IT FIRST.\n", + "\n", + "TACITUS CLEARLY WANTED TO MAKE IT DIFFICULT TO ASSEMBLE THE ENTIRE DOCUMENT, SO HE HAD IT HIDDEN AT A NUMBER OF SITES AROUND THE ANCIENT WORLD. THE BRITISH LIBRARY DECIDED TO SEND SOMEONE TO TRY TO FIND ALL THE PIECES. THEIR EXPERTS FIGURED THE CHAPTERS WERE LIKELY TO BE ENCRYPTED TOO SO, GIVEN MY BACKGROUND, THEY ASKED ME TO GO. THEY WERE RIGHT OF COURSE, THE FIRST CHAPTER WAS DISGUISED USING A CAESAR SHIFT AND THE SECOND BY A SCYTALE CIPHER, AND I AM BEGINNING TO WONDER WHAT OTHER CIPHERS TACITUS MIGHT CHALLENGE US WITH. AS FAR AS WE KNOW THE ROMANS WOULD NOT HAVE HAD THAT MANY TO CHOOSE FROM. I SUPPOSE HE MIGHT HAVE KNOWN ABOUT SOME FORM OF THE POLYBIUS CIPHER.\n", + "\n", + "THE DOCUMENTS I HAVE FOUND SO FAR (TACITUS LAST TESTAMENT AND CHAPTERS ONE AND TWO OF HIS HIDDEN BOOK) EACH GIVE A CLUE TO THE LOCATION OF THE NEXT ONE, AND AS SOON AS THEY LET ME OUT OF HOSPITAL I PLAN TO TRY TO LOCATE THE THIRD CHAPTER, WHICH TACITUS TELLS US IS HIDDEN ON THE ISLE OF THORNS. THERE ARE SEVERAL PLACES IN THE ANCIENT WORLD THAT THIS MIGHT REFER TO, BUT I HAVE A PRETTY GOOD IDEA OF WHERE IT MIGHT BE.\n", + "\n", + "IF I THINK OF ANYTHING ELSE I WILL GET IT TO YOU, AND AS REQUESTED I WILL COPY IN YOUR FRIEND HARRY. I SUGGEST WE TIGHTEN SECURITY A LITTLE. MAYBE IF WE BLOCK OUR CIPHER TEXTS LIKE THE EXPERTS IT WILL PUT OFF CASUAL INTERCEPTS. THE PEOPLE WE ARE UP AGAINST ARE UNLIKELY TO BE DETERRED BY MUCH, BUT WE DON'T WANT TO INVITE EXTRA INTERLOPERS TO THE PARTY.\n", + "\n", + "BY THE WAY, MY FRIEND IN THE SOUK TOLD ME THAT HE MET ONE OF YOUR AGENTS WHO WAS ASKING IF HE KNEW WHERE I WAS, WHICH SEEMS A BIT ODD GIVEN THAT YOU KNOW I AM STUCK HERE. WAS THAT JUST TO THROW OUR RIVALS OFF THE SCENT?\n", + "\n", + "ALL THE BEST,\n", + "\n", + "JODIE\n" + ] + } + ], + "source": [ + "print(affine_decipher(ca, m_a, a_a, o_a))" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2163" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open('2a.plaintext', 'w').write(affine_decipher(ca, m_a, a_a, o_a))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Counter({'c': 1064, 'd': 1368, 'l': 756, 'm': 566, 'x': 1092})" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "collections.Counter(sanitise(cb))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('xm', 317),\n", + " ('dd', 240),\n", + " ('xx', 197),\n", + " ('ld', 185),\n", + " ('cd', 177),\n", + " ('dl', 159),\n", + " ('dc', 155),\n", + " ('cc', 154),\n", + " ('lc', 133),\n", + " ('xd', 105),\n", + " ('cx', 92),\n", + " ('xc', 88),\n", + " ('dm', 70),\n", + " ('cl', 58),\n", + " ('ml', 51),\n", + " ('cm', 48),\n", + " ('ll', 45),\n", + " ('lx', 41),\n", + " ('md', 36),\n", + " ('mx', 27),\n", + " ('xl', 27),\n", + " ('lm', 12),\n", + " ('mc', 5),\n", + " ('dx', 1)]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "collections.Counter(chunks(sanitise(cb), 2)).most_common()" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'etoainhsrdlumwycfgpbvkxqz'" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ltrs = [p[0] for p in english_counts.most_common() if p[0] != 'j']\n", + "cat(ltrs)" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'etoanisrhdlufcmwgybpvkxqz'" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ltrs = cat(p[0] for p in \n", + " collections.Counter(sanitise(open('1b.plaintext').read() + open('2b.plaintext').read())).most_common()\n", + " if p[0] != 'j')\n", + "ltrs" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['xm',\n", + " 'dd',\n", + " 'xx',\n", + " 'ld',\n", + " 'cd',\n", + " 'dl',\n", + " 'dc',\n", + " 'cc',\n", + " 'lc',\n", + " 'xd',\n", + " 'cx',\n", + " 'xc',\n", + " 'dm',\n", + " 'cl',\n", + " 'ml',\n", + " 'cm',\n", + " 'll',\n", + " 'lx',\n", + " 'md',\n", + " 'mx',\n", + " 'xl',\n", + " 'lm',\n", + " 'mc',\n", + " 'dx']" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "prs = [p[0] for p in collections.Counter(chunks(sanitise(cb), 2)).most_common()]\n", + "prs" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "24" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(prs)" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'cc': 'R',\n", + " 'cd': 'N',\n", + " 'cl': 'C',\n", + " 'cm': 'W',\n", + " 'cx': 'L',\n", + " 'dc': 'S',\n", + " 'dd': 'T',\n", + " 'dl': 'I',\n", + " 'dm': 'F',\n", + " 'dx': 'Q',\n", + " 'lc': 'H',\n", + " 'ld': 'A',\n", + " 'll': 'G',\n", + " 'lm': 'K',\n", + " 'lx': 'Y',\n", + " 'mc': 'X',\n", + " 'md': 'B',\n", + " 'ml': 'M',\n", + " 'mx': 'P',\n", + " 'xc': 'U',\n", + " 'xd': 'D',\n", + " 'xl': 'V',\n", + " 'xm': 'E',\n", + " 'xx': 'O'}" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trans = {pr[1]: pr[0].upper() for pr in zip(ltrs, prs)}\n", + "trans" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['ml',\n", + " 'lc',\n", + " 'ld',\n", + " 'cx',\n", + " 'xm',\n", + " 'ld',\n", + " 'dd',\n", + " 'ld',\n", + " 'dc',\n", + " 'dd',\n", + " 'dl',\n", + " 'dm',\n", + " 'xm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xx',\n", + " 'dd',\n", + " 'dc',\n", + " 'dm',\n", + " 'xm',\n", + " 'dd',\n", + " 'cd',\n", + " 'cc',\n", + " 'ld',\n", + " 'dm',\n", + " 'dc',\n", + " 'dc',\n", + " 'xm',\n", + " 'dd',\n", + " 'dm',\n", + " 'cm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'lx',\n", + " 'ld',\n", + " 'cc',\n", + " 'xx',\n", + " 'cx',\n", + " 'xl',\n", + " 'xx',\n", + " 'dd',\n", + " 'dd',\n", + " 'cx',\n", + " 'xm',\n", + " 'ml',\n", + " 'ld',\n", + " 'dd',\n", + " 'lc',\n", + " 'xl',\n", + " 'cd',\n", + " 'dm',\n", + " 'xd',\n", + " 'ld',\n", + " 'xc',\n", + " 'xc',\n", + " 'xx',\n", + " 'xx',\n", + " 'dd',\n", + " 'ml',\n", + " 'xx',\n", + " 'dd',\n", + " 'cx',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'dc',\n", + " 'dd',\n", + " 'dl',\n", + " 'xm',\n", + " 'xm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'lc',\n", + " 'xx',\n", + " 'xd',\n", + " 'cc',\n", + " 'xm',\n", + " 'ld',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'dl',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'dd',\n", + " 'dl',\n", + " 'cd',\n", + " 'cd',\n", + " 'cm',\n", + " 'dc',\n", + " 'cc',\n", + " 'cd',\n", + " 'dl',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'dd',\n", + " 'xx',\n", + " 'xc',\n", + " 'dd',\n", + " 'ld',\n", + " 'xc',\n", + " 'xx',\n", + " 'cx',\n", + " 'xx',\n", + " 'xl',\n", + " 'ld',\n", + " 'cx',\n", + " 'ld',\n", + " 'dd',\n", + " 'md',\n", + " 'dd',\n", + " 'cd',\n", + " 'cd',\n", + " 'mx',\n", + " 'xm',\n", + " 'dl',\n", + " 'xc',\n", + " 'cd',\n", + " 'cl',\n", + " 'xm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'lc',\n", + " 'dm',\n", + " 'll',\n", + " 'xm',\n", + " 'cc',\n", + " 'dm',\n", + " 'cl',\n", + " 'xm',\n", + " 'dl',\n", + " 'ld',\n", + " 'xc',\n", + " 'xx',\n", + " 'cx',\n", + " 'xd',\n", + " 'ld',\n", + " 'dc',\n", + " 'xx',\n", + " 'xd',\n", + " 'mx',\n", + " 'xx',\n", + " 'cc',\n", + " 'dd',\n", + " 'xx',\n", + " 'll',\n", + " 'xm',\n", + " 'lx',\n", + " 'xx',\n", + " 'xc',\n", + " 'xm',\n", + " 'xd',\n", + " 'xl',\n", + " 'md',\n", + " 'lc',\n", + " 'ld',\n", + " 'dc',\n", + " 'xx',\n", + " 'dl',\n", + " 'cl',\n", + " 'md',\n", + " 'ml',\n", + " 'ld',\n", + " 'dd',\n", + " 'lc',\n", + " 'cd',\n", + " 'dm',\n", + " 'dd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'dc',\n", + " 'dm',\n", + " 'cm',\n", + " 'cm',\n", + " 'cd',\n", + " 'dl',\n", + " 'dd',\n", + " 'cd',\n", + " 'lx',\n", + " 'xx',\n", + " 'll',\n", + " 'dl',\n", + " 'ld',\n", + " 'xc',\n", + " 'cd',\n", + " 'cx',\n", + " 'xx',\n", + " 'xx',\n", + " 'cc',\n", + " 'xd',\n", + " 'lc',\n", + " 'ld',\n", + " 'dc',\n", + " 'dd',\n", + " 'xx',\n", + " 'cx',\n", + " 'xm',\n", + " 'cc',\n", + " 'dd',\n", + " 'xm',\n", + " 'xd',\n", + " 'dc',\n", + " 'xc',\n", + " 'cd',\n", + " 'dm',\n", + " 'dd',\n", + " 'dc',\n", + " 'xd',\n", + " 'xm',\n", + " 'lx',\n", + " 'xm',\n", + " 'xx',\n", + " 'dd',\n", + " 'ml',\n", + " 'cd',\n", + " 'dm',\n", + " 'cx',\n", + " 'xd',\n", + " 'lc',\n", + " 'xx',\n", + " 'mx',\n", + " 'xm',\n", + " 'xl',\n", + " 'xm',\n", + " 'xm',\n", + " 'cc',\n", + " 'ld',\n", + " 'cc',\n", + " 'xm',\n", + " 'mx',\n", + " 'ld',\n", + " 'dd',\n", + " 'xx',\n", + " 'xl',\n", + " 'cx',\n", + " 'xm',\n", + " 'xx',\n", + " 'cc',\n", + " 'xd',\n", + " 'ml',\n", + " 'ld',\n", + " 'dd',\n", + " 'lc',\n", + " 'ld',\n", + " 'dd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'cx',\n", + " 'cd',\n", + " 'dc',\n", + " 'dc',\n", + " 'cd',\n", + " 'lx',\n", + " 'xl',\n", + " 'dl',\n", + " 'ld',\n", + " 'dd',\n", + " 'xx',\n", + " 'cc',\n", + " 'cc',\n", + " 'ld',\n", + " 'xx',\n", + " 'lc',\n", + " 'xx',\n", + " 'mx',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'dl',\n", + " 'xm',\n", + " 'xx',\n", + " 'cx',\n", + " 'ld',\n", + " 'dc',\n", + " 'xm',\n", + " 'xd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xx',\n", + " 'dd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'ld',\n", + " 'xc',\n", + " 'xm',\n", + " 'cc',\n", + " 'ld',\n", + " 'ml',\n", + " 'xm',\n", + " 'dl',\n", + " 'xm',\n", + " 'dl',\n", + " 'xm',\n", + " 'xx',\n", + " 'xd',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'lc',\n", + " 'ld',\n", + " 'dc',\n", + " 'xc',\n", + " 'cd',\n", + " 'cl',\n", + " 'cl',\n", + " 'dm',\n", + " 'cc',\n", + " 'ld',\n", + " 'xc',\n", + " 'xx',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'dc',\n", + " 'xx',\n", + " 'll',\n", + " 'dl',\n", + " 'ld',\n", + " 'xc',\n", + " 'cd',\n", + " 'cx',\n", + " 'xx',\n", + " 'xx',\n", + " 'dl',\n", + " 'dl',\n", + " 'xx',\n", + " 'cc',\n", + " 'll',\n", + " 'xm',\n", + " 'xd',\n", + " 'dd',\n", + " 'cd',\n", + " 'cm',\n", + " 'cx',\n", + " 'xx',\n", + " 'cc',\n", + " 'dd',\n", + " 'lx',\n", + " 'xx',\n", + " 'cx',\n", + " 'dc',\n", + " 'xm',\n", + " 'ld',\n", + " 'cc',\n", + " 'lx',\n", + " 'cd',\n", + " 'dl',\n", + " 'cl',\n", + " 'xx',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'xx',\n", + " 'xl',\n", + " 'cd',\n", + " 'dm',\n", + " 'dd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'cm',\n", + " 'cx',\n", + " 'xx',\n", + " 'cc',\n", + " 'cc',\n", + " 'xm',\n", + " 'xd',\n", + " 'xd',\n", + " 'ld',\n", + " 'dc',\n", + " 'cm',\n", + " 'cd',\n", + " 'dc',\n", + " 'ld',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'cd',\n", + " 'lx',\n", + " 'dd',\n", + " 'dl',\n", + " 'cd',\n", + " 'cd',\n", + " 'cm',\n", + " 'dc',\n", + " 'dc',\n", + " 'xm',\n", + " 'dd',\n", + " 'dd',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'xx',\n", + " 'dd',\n", + " 'dl',\n", + " 'xx',\n", + " 'cm',\n", + " 'ld',\n", + " 'cc',\n", + " 'dd',\n", + " 'cd',\n", + " 'ml',\n", + " 'lc',\n", + " 'ld',\n", + " 'xc',\n", + " 'lc',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'ld',\n", + " 'xc',\n", + " 'xm',\n", + " 'cc',\n", + " 'ld',\n", + " 'lx',\n", + " 'xm',\n", + " 'cx',\n", + " 'cx',\n", + " 'ld',\n", + " 'dd',\n", + " 'ld',\n", + " 'dc',\n", + " 'dc',\n", + " 'dd',\n", + " 'ld',\n", + " 'cx',\n", + " 'cx',\n", + " 'dm',\n", + " 'cc',\n", + " 'xc',\n", + " 'cx',\n", + " 'xm',\n", + " 'xx',\n", + " 'dl',\n", + " 'lc',\n", + " 'cd',\n", + " 'ml',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'dc',\n", + " 'xx',\n", + " 'mx',\n", + " 'xx',\n", + " 'll',\n", + " 'xm',\n", + " 'dd',\n", + " 'dl',\n", + " 'ld',\n", + " 'xl',\n", + " 'xm',\n", + " 'dc',\n", + " 'lc',\n", + " 'xx',\n", + " 'xd',\n", + " 'cx',\n", + " 'xm',\n", + " 'xx',\n", + " 'dl',\n", + " 'cc',\n", + " 'xm',\n", + " 'xd',\n", + " 'dd',\n", + " 'cd',\n", + " 'xd',\n", + " 'xm',\n", + " 'xc',\n", + " 'ld',\n", + " 'cm',\n", + " 'lc',\n", + " 'xm',\n", + " 'dl',\n", + " 'cd',\n", + " 'dm',\n", + " 'dl',\n", + " 'xx',\n", + " 'dl',\n", + " 'cl',\n", + " 'md',\n", + " 'dc',\n", + " 'xc',\n", + " 'cd',\n", + " 'cl',\n", + " 'cl',\n", + " 'dm',\n", + " 'cc',\n", + " 'ld',\n", + " 'xc',\n", + " 'xx',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'dc',\n", + " 'xx',\n", + " 'dc',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'md',\n", + " 'lc',\n", + " 'xx',\n", + " 'xd',\n", + " 'cc',\n", + " 'cd',\n", + " 'ml',\n", + " 'dl',\n", + " 'ld',\n", + " 'dd',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'cd',\n", + " 'lx',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'ld',\n", + " 'dl',\n", + " 'cd',\n", + " 'ml',\n", + " 'cc',\n", + " 'lc',\n", + " 'cd',\n", + " 'ml',\n", + " 'xm',\n", + " 'mx',\n", + " 'xm',\n", + " 'dl',\n", + " 'xm',\n", + " 'mx',\n", + " 'xm',\n", + " 'dl',\n", + " 'md',\n", + " 'xx',\n", + " 'dl',\n", + " 'cl',\n", + " 'md',\n", + " 'lc',\n", + " 'xx',\n", + " 'dc',\n", + " 'ld',\n", + " 'dd',\n", + " 'dc',\n", + " 'dd',\n", + " 'dl',\n", + " 'xx',\n", + " 'ld',\n", + " 'dd',\n", + " 'cd',\n", + " 'dl',\n", + " 'dc',\n", + " 'xx',\n", + " 'cc',\n", + " 'xd',\n", + " 'ld',\n", + " 'dd',\n", + " 'dc',\n", + " 'xm',\n", + " 'xm',\n", + " 'cl',\n", + " 'dc',\n", + " 'cx',\n", + " 'ld',\n", + " 'lm',\n", + " 'xm',\n", + " 'cx',\n", + " 'md',\n", + " 'dd',\n", + " 'cd',\n", + " 'cl',\n", + " 'xm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xx',\n", + " 'dd',\n", + " 'cd',\n", + " 'cc',\n", + " 'xm',\n", + " 'cd',\n", + " 'dl',\n", + " 'cl',\n", + " 'cd',\n", + " 'dl',\n", + " 'xm',\n", + " 'cd',\n", + " 'lx',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'cx',\n", + " 'cd',\n", + " 'xc',\n", + " 'xx',\n", + " 'cx',\n", + " 'dd',\n", + " 'dl',\n", + " 'ld',\n", + " 'xl',\n", + " 'xm',\n", + " 'dc',\n", + " 'cm',\n", + " 'xm',\n", + " 'cd',\n", + " 'cm',\n", + " 'cx',\n", + " 'xm',\n", + " 'dd',\n", + " 'dm',\n", + " 'dl',\n", + " 'cc',\n", + " 'xm',\n", + " 'xd',\n", + " 'dc',\n", + " 'cd',\n", + " 'cl',\n", + " 'xm',\n", + " 'cd',\n", + " 'cc',\n", + " 'xm',\n", + " 'dc',\n", + " 'lc',\n", + " 'xm',\n", + " 'xx',\n", + " 'xd',\n", + " 'cx',\n", + " 'cd',\n", + " 'mx',\n", + " 'xm',\n", + " 'cd',\n", + " 'dl',\n", + " 'cl',\n", + " 'cd',\n", + " 'cc',\n", + " 'xm',\n", + " 'md',\n", + " 'ld',\n", + " 'dd',\n", + " 'ld',\n", + " 'dc',\n", + " 'xx',\n", + " 'cx',\n", + " 'cx',\n", + " 'dd',\n", + " 'dl',\n", + " 'xm',\n", + " 'xx',\n", + " 'xc',\n", + " 'lc',\n", + " 'xm',\n", + " 'dl',\n", + " 'md',\n", + " 'xl',\n", + " 'dm',\n", + " 'dd',\n", + " 'dd',\n", + " 'lc',\n", + " 'ld',\n", + " 'dc',\n", + " 'xx',\n", + " 'xc',\n", + " 'dd',\n", + " 'dd',\n", + " 'lc',\n", + " 'dl',\n", + " 'xm',\n", + " 'xx',\n", + " 'dd',\n", + " 'xm',\n", + " 'cc',\n", + " 'xm',\n", + " 'xd',\n", + " 'dd',\n", + " 'cd',\n", + " 'dm',\n", + " 'cc',\n", + " 'xd',\n", + " 'xm',\n", + " 'dl',\n", + " 'cl',\n", + " 'ld',\n", + " 'cc',\n", + " 'xm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'xm',\n", + " 'cl',\n", + " 'cm',\n", + " 'ld',\n", + " 'dl',\n", + " 'xm',\n", + " 'dc',\n", + " 'xm',\n", + " 'cc',\n", + " 'dd',\n", + " 'ld',\n", + " 'dl',\n", + " 'xm',\n", + " 'dc',\n", + " 'md',\n", + " 'dc',\n", + " 'dd',\n", + " 'xm',\n", + " 'cl',\n", + " 'cd',\n", + " 'lx',\n", + " 'dc',\n", + " 'xm',\n", + " 'xc',\n", + " 'dm',\n", + " 'dl',\n", + " 'xm',\n", + " 'xc',\n", + " 'cd',\n", + " 'cl',\n", + " 'cl',\n", + " 'dm',\n", + " 'cc',\n", + " 'ld',\n", + " 'xc',\n", + " 'xx',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'xc',\n", + " 'xx',\n", + " 'xm',\n", + " 'dc',\n", + " 'xx',\n", + " 'dl',\n", + " 'xc',\n", + " 'ld',\n", + " 'cm',\n", + " 'lc',\n", + " 'xm',\n", + " 'dl',\n", + " 'cm',\n", + " 'xm',\n", + " 'dl',\n", + " 'lc',\n", + " 'xx',\n", + " 'cm',\n", + " 'dc',\n", + " 'cl',\n", + " 'cd',\n", + " 'dl',\n", + " 'xm',\n", + " 'dd',\n", + " 'lc',\n", + " 'xx',\n", + " 'cc',\n", + " 'dl',\n", + " 'cd',\n", + " 'xx',\n", + " 'xd',\n", + " 'dc',\n", + " 'lc',\n", + " 'xx',\n", + " 'xd',\n", + " 'xm',\n", + " 'cc',\n", + " 'xx',\n", + " 'xl',\n", + " 'cx',\n", + " 'xm',\n", + " 'xd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'xm',\n", + " 'cl',\n", + " 'cm',\n", + " 'ld',\n", + " 'dl',\n", + " 'xm',\n", + " 'dd',\n", + " 'cd',\n", + " 'lx',\n", + " 'dm',\n", + " 'cc',\n", + " 'xc',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'dc',\n", + " 'xm',\n", + " 'xc',\n", + " 'dm',\n", + " 'dl',\n", + " 'xm',\n", + " 'cx',\n", + " 'md',\n", + " 'xx',\n", + " 'cc',\n", + " 'xd',\n", + " 'ld',\n", + " 'dd',\n", + " 'dc',\n", + " 'cx',\n", + " 'cd',\n", + " 'dc',\n", + " 'dc',\n", + " 'ml',\n", + " 'xx',\n", + " 'dc',\n", + " 'xx',\n", + " 'xd',\n", + " 'ld',\n", + " 'dc',\n", + " 'xx',\n", + " 'dc',\n", + " 'dd',\n", + " 'xm',\n", + " 'dl',\n", + " 'dd',\n", + " 'dm',\n", + " 'dl',\n", + " 'cc',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'dd',\n", + " 'lc',\n", + " 'xx',\n", + " 'dd',\n", + " 'cx',\n", + " 'cd',\n", + " 'dc',\n", + " 'dc',\n", + " 'ld',\n", + " 'cc',\n", + " 'dd',\n", + " 'cd',\n", + " 'xx',\n", + " 'mx',\n", + " 'ld',\n", + " 'xc',\n", + " 'dd',\n", + " 'cd',\n", + " 'dl',\n", + " 'md',\n", + " 'cd',\n", + " 'cc',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'xl',\n", + " 'xx',\n", + " 'dd',\n", + " 'dd',\n", + " 'cx',\n", + " 'xm',\n", + " 'lx',\n", + " 'ld',\n", + " 'xm',\n", + " 'cx',\n", + " 'xd',\n", + " 'xd',\n", + " 'xm',\n", + " 'dc',\n", + " 'xm',\n", + " 'dl',\n", + " 'mx',\n", + " 'xm',\n", + " 'xd',\n", + " 'cl',\n", + " 'cd',\n", + " 'dl',\n", + " 'xm',\n", + " 'dl',\n", + " 'xm',\n", + " 'xc',\n", + " 'cd',\n", + " 'll',\n", + " 'cc',\n", + " 'ld',\n", + " 'dd',\n", + " 'ld',\n", + " 'cd',\n", + " 'cc',\n", + " 'dd',\n", + " 'lc',\n", + " 'xx',\n", + " 'cc',\n", + " 'ld',\n", + " 'dd',\n", + " 'dl',\n", + " 'xm',\n", + " 'xc',\n", + " 'xm',\n", + " 'ld',\n", + " 'mx',\n", + " 'xm',\n", + " 'xd',\n", + " 'cm',\n", + " 'xm',\n", + " 'dl',\n", + " 'lc',\n", + " 'xx',\n", + " 'cm',\n", + " 'dc',\n", + " 'dc',\n", + " 'dm',\n", + " 'xm',\n", + " 'dd',\n", + " 'cd',\n", + " 'cc',\n", + " 'ld',\n", + " 'dm',\n", + " 'dc',\n", + " 'cc',\n", + " 'xm',\n", + " 'mx',\n", + " 'xm',\n", + " 'dl',\n", + " 'lm',\n", + " 'cc',\n", + " 'xm',\n", + " 'ml',\n", + " 'cd',\n", + " 'dl',\n", + " 'cm',\n", + " 'xm',\n", + " 'dl',\n", + " 'lc',\n", + " 'xx',\n", + " 'cm',\n", + " 'dc',\n", + " 'lc',\n", + " 'xm',\n", + " 'lx',\n", + " 'xx',\n", + " 'ld',\n", + " 'cx',\n", + " 'xm',\n", + " 'xd',\n", + " 'dd',\n", + " 'cd',\n", + " 'dm',\n", + " 'cc',\n", + " 'xd',\n", + " 'xm',\n", + " 'dl',\n", + " 'dc',\n", + " 'dd',\n", + " 'xx',\n", + " 'cc',\n", + " 'xd',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'xc',\n", + " 'dm',\n", + " 'cc',\n", + " 'cc',\n", + " 'ld',\n", + " 'cc',\n", + " 'll',\n", + " 'cd',\n", + " 'lx',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'cm',\n", + " 'cx',\n", + " 'xx',\n", + " 'cc',\n", + " 'xl',\n", + " 'dm',\n", + " 'dd',\n", + " 'xm',\n", + " 'ld',\n", + " 'dd',\n", + " 'lc',\n", + " 'xm',\n", + " 'dl',\n", + " 'ml',\n", + " 'xx',\n", + " 'md',\n", + " 'xd',\n", + " 'xm',\n", + " 'dc',\n", + " 'cm',\n", + " ...]" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "scb = sanitise(cb)\n", + "scbp = chunks(scb, 2)\n", + "scbp" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'MHALEATASTIFETHOTSFETNRAFSSETFWTHEYAROLVOTTLEMATHVNFDAUUOOTMOTLARGSTIEETHEHODREATHEITHETINNWSRNITHETOUTAUOLOVALATBTNNPEIUNCETHEHFGERFCEIAUOLDASODPORTOGEYOUEDVBHASOICBMATHNFTTHESFWWNITNYOGIAUNLOORDHASTOLERTEDSUNFTSDEYEOTMNFLDHOPEVEERAREPATOVLEORDMATHATTHELNSSNYVIATORRAOHOPARGIEOLASEDTHOTTHEAUERAMEIEIEODARGHASUNCCFRAUOTANRSOGIAUNLOOIIORGEDTNWLORTYOLSEARYNICOTANROVNFTTHEWLORREDDASWNSATANRNYTINNWSSETTARGOTIOWARTNMHAUHTHEAUERAYELLATASSTALLFRULEOIHNMTHESOPOGETIAVESHODLEOIREDTNDEUAWHEINFIOICBSUNCCFRAUOTANRSOSTHEBHODRNMIATARGNYTHEAINMRHNMEPEIEPEIBOICBHOSATSTIOATNISORDATSEECSLAKELBTNCETHOTNRENICNIENYTHELNUOLTIAVESWENWLETFIREDSNCENRESHEODLNPENICNREBATASOLLTIEOUHEIBVFTTHASOUTTHIEOTEREDTNFRDEICARETHEECWAIESERTAIESBSTECNYSEUFIEUNCCFRAUOTANRTHEUOESOIUAWHEIWEIHOWSCNIETHORINODSHODEROVLEDTHEECWAIETNYFRUTANRSEUFIELBORDATSLNSSMOSODASOSTEITFIRARGTHOTLNSSARTNOPAUTNIBNRTHEVOTTLEYAELDDESEIPEDCNIEIEUNGRATANRTHORATIEUEAPEDWEIHOWSSFETNRAFSREPEIKREMNIWEIHOWSHEYOALEDTNFRDEISTORDTHEUFRRARGNYTHEWLORVFTEATHEIMOBDESWATETHEPAUTNIBOGIAUNLOORDTHERARTHLEGANRIECOAREDARDASGIOUENRHEOIARGTHASREMSULOFDAFSUOESOIOFGFSTFSGEICORAUFSREINECWEINIASSFEDOSEUIETWINULOCOTANRESTOVLASHARGOUAWHEISUHNNLTNDEPELNWOREMSBSTECNYACWEIAOLUAWHEISATMNIKEDARSEUIETYNINPEITMERTBBEOISDEPELNWARGREMCETHNDSTNSEUFIEUNCCFRAUOTANRSOUINSSTHEECWAIESTFDBARGTHEMNIKSNYTHEGIEEKSOGESEFULADORDHBWOTAOORDEPERNLDEIMNIKSYINCORUAERTVOVBLNRTHESUHNNLDEPELNWEDREMMOBSTNSOYEGFOIDUNCCFRAUOTANRSYINCINCESERECAESTHESEREMSBSTECSMEIEMIATTERDNMRORDDASTIAVFTEDARTHEUNDEXNUUFLTNIFCWEIHOWSTHECNSTSTIAUTLBGFOIDEDDNUFCERTAROLLHASTNIBMHERATMOSYAROLLBUNCWLETEDCORBBEOISLOTEITHEECWEINIDNCATAORASSFEDOREXEUFTAPENIDEIMHAUHWIEYOUEDEPEIBUNWBNYTHEUNDEXTHOTATMOSTNVEGFOIDEDVBEPEIBLEGANRTNTHELOSTCORTHEDEYEOTNYTHEAUERAORDTHESFAUADENYVNFDAUUOWEIHOWSWINTEUTEDTHERARTHLEGANRYINCDASSNLFTANROGIAUNLOMOSLOIGELBLEYTTNHASNMRDEPAUESARTHEWINPARUETHNFGHATMOSCODEULEOITNHACTHOTTNIETFIRMNFLDCEOROTVESTDASGIOUEORDOTMNISTDEOTHAROVIEOKMATHTIODATANRTHERARTHIOASEDOREMSTORDOIDTHELEGANRMOSEXALEDARDASGIOUETNERDFIETHEHOIDORDDORGEINFSMNIKNYSFVDFARGTHEUOLEDNRAAARTHEVLEOKMALDEIRESSESNYUOLEDNRAOSFETNRAFSNIDEIEDTHERARTHTNCOIUHTNEVNIOUFCMHAUHTHEBMEIETNCOKETHEAIVOSEYNIIOADSARTNUOLEDNRAOTHEFRSWNKERIEOSNRYNITHEAIEXALEMOSTHOTARTELLAGERUEIEWNITSSFGGESTEDTHOTTHASMOSMHEIETHEBCAGHTYARDTHEAILNSTOQFALOTHNSEMHNMNFLDIEODNRCFSTYNLLNMCBYOATHYFLSLOPETAINMHNYOUESOGIOPETOSKWEIHOWSTHELOIGESTTNDOTEOSHETIOPELSTNUNRUEOLTHEYNFITHUHOWTEINYTHASTIOGAUTOLE'" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "scbpt = cat(trans[p] for p in scbp)\n", + "scbpt" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'MhaLeatastrFethotsFetnRaFssetFWtheYaRoLVottLeMathVnFDaUUootMotLaRGstreethehoDReatherthetrnnWsRnrthetoUtaUoLoVaLatBtnnPerUnCethehFGeRFCeraUoLDasoDPoRtoGeYoUeDVBhasorCBMathnFtthesFWWnrtnYoGraUnLooRDhastoLeRteDsUnFtsDeYeotMnFLDhoPeVeeRaRePatoVLeoRDMathattheLnssnYVratoRRaohoPaRGreoLaseDthottheaUeRaMerereoDaRGhasUnCCFRaUotanRsoGraUnLoorroRGeDtnWLoRtYoLseaRYnrCotanRoVnFttheWLoRReDDasWnsatanRnYtrnnWssettaRGotroWaRtnMhaUhtheaUeRaYeLLatasstaLLFRULeorhnMthesoPoGetraVeshoDLeorReDtnDeUaWhernFrorCBsUnCCFRaUotanRsostheBhoDRnMrataRGnYthearnMRhnMePerePerBorCBhosatstroatnrsoRDatseeCsLaKeLBtnCethotnRenrCnrenYtheLnUoLtraVesWenWLetFrReDsnCenResheoDLnPenrCnReBatasoLLtreoUherBVFtthasoUtthreoteReDtnFRDerCaRetheeCWareseRtaresBsteCnYseUFreUnCCFRaUotanRtheUoesorUaWherWerhoWsCnrethoRrnoDshoDeRoVLeDtheeCWaretnYFRUtanRseUFreLBoRDatsLnssMosoDasostertFrRaRGthotLnssaRtnoPaUtnrBnRtheVottLeYaeLDDeserPeDCnrereUnGRatanRthoRatreUeaPeDWerhoWssFetnRaFsRePerKReMnrWerhoWsheYoaLeDtnFRDerstoRDtheUFRRaRGnYtheWLoRVFteatherMoBDesWatethePaUtnrBoGraUnLooRDtheRaRthLeGanRreCoaReDaRDasGroUenRheoraRGthasReMsULoFDaFsUoesoroFGFstFsGerCoRaUFsRerneCWernrassFeDoseUretWrnULoCotanRestoVLashaRGoUaWhersUhnnLtnDePeLnWoReMsBsteCnYaCWeraoLUaWhersatMnrKeDaRseUretYnrnPertMeRtBBeorsDePeLnWaRGReMCethnDstnseUFreUnCCFRaUotanRsoUrnsstheeCWarestFDBaRGtheMnrKsnYtheGreeKsoGeseFULaDoRDhBWotaooRDePeRnLDerMnrKsYrnCoRUaeRtVoVBLnRthesUhnnLDePeLnWeDReMMoBstnsoYeGForDUnCCFRaUotanRsYrnCrnCeseReCaestheseReMsBsteCsMereMratteRDnMRoRDDastraVFteDaRtheUnDeXnUUFLtnrFCWerhoWstheCnststraUtLBGForDeDDnUFCeRtaRoLLhastnrBMheRatMosYaRoLLBUnCWLeteDCoRBBeorsLotertheeCWernrDnCataoRassFeDoReXeUFtaPenrDerMhaUhWreYoUeDePerBUnWBnYtheUnDeXthotatMostnVeGForDeDVBePerBLeGanRtntheLostCoRtheDeYeotnYtheaUeRaoRDthesFaUaDenYVnFDaUUoWerhoWsWrnteUteDtheRaRthLeGanRYrnCDassnLFtanRoGraUnLoMosLorGeLBLeYttnhasnMRDePaUesaRtheWrnPaRUethnFGhatMosCoDeULeortnhaCthottnretFrRMnFLDCeoRotVestDasGroUeoRDotMnrstDeothaRoVreoKMathtroDatanRtheRaRthroaseDoReMstoRDorDtheLeGanRMoseXaLeDaRDasGroUetneRDFrethehorDoRDDoRGernFsMnrKnYsFVDFaRGtheUoLeDnRaaaRtheVLeoKMaLDerRessesnYUoLeDnRaosFetnRaFsnrDereDtheRaRthtnCorUhtneVnroUFCMhaUhtheBMeretnCoKethearVoseYnrroaDsaRtnUoLeDnRaotheFRsWnKeRreosnRYnrtheareXaLeMosthotaRteLLaGeRUereWnrtssFGGesteDthotthasMosMheretheBCaGhtYaRDthearLnstoQFaLothnseMhnMnFLDreoDnRCFstYnLLnMCBYoathYFLsLoPetarnMhnYoUesoGroPetosKWerhoWstheLorGesttnDoteoshetroPeLstnUnRUeoLtheYnFrthUhoWternYthastroGaUtoLe'" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tr = {}\n", + "tr['E'] = 'e'\n", + "tr['T'] = 't'\n", + "tr['O'] = 'o'\n", + "tr['A'] = 'a'\n", + "tr['I'] = 'r'\n", + "tr['N'] = 'n'\n", + "tr['H'] = 'h'\n", + "tr['S'] = 's'\n", + "# english: etoainhs rdlumwycfgpbvkxqz\n", + "# texts: etoanisrhdlufcmwgybpvkxqz\n", + "\n", + "\n", + "trans = ''.maketrans(tr)\n", + "scbpt.translate(trans)" + ] + }, + { + "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.5.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/2017/3a.ciphertext b/2017/3a.ciphertext new file mode 100644 index 0000000..5d1a2d8 --- /dev/null +++ b/2017/3a.ciphertext @@ -0,0 +1,16 @@ +ICROCI, +G FZWMSZF YWIE IWRE CJWMF AZCF OWM YCGX GP FZE ZWYDGFCB, CPX SGTEP AZCF ZCY ZCDDEPEX G FZGPU G GF AWMBX JE SWWX FW AWRU FWSEFZER. + +MPLWRFMPCFEBO GF YEEIY FZCF G CI PWF FZE WPBO WPE FROGPS FW LGPX FZE JWWU. FZERE GY C FZRGTGPS JBCQU ICRUEF CIWPS JGJBGWDZGBEY LWR CPOFZGPS CY WBX CY FZGY. GF GY TERO TCBMCJBE CPX GL FZE JWWU XGYCDDECRY GPFW FZE YZCXWAO AWRBX WL DRGTCFE BGJRCRGEY AE IGSZF PWF YEE GF CSCGP LWR QEPFMRGEY YW GF GY RECBBO GIDWRFCPF AE SEF FW GF LGRYF. + +FCQGFMY QBECRBO ACPFEX FW ICUE GF XGLLGQMBF FW CYYEIJBE FZE EPFGRE XWQMIEPF, YW ZE ZCX GF ZGXXEP CF C PMIJER WL YGFEY CRWMPX FZE CPQGEPF AWRBX. FZE JRGFGYZ BGJRCRO XEQGXEX FW YEPX YWIEWPE FW FRO FW LGPX CBB FZE DGEQEY. FZEGR EHDERFY LGSMREX FZE QZCDFERY AERE BGUEBO FW JE EPQRODFEX FWW YW, SGTEP IO JCQUSRWMPX, FZEO CYUEX IE FW SW. FZEO AERE RGSZF WL QWMRYE, FZE LGRYF QZCDFER ACY XGYSMGYEX MYGPS C QCEYCR YZGLF CPX FZE YEQWPX JO C YQOFCBE QGDZER, CPX G CI JESGPPGPS FW AWPXER AZCF WFZER QGDZERY FCQGFMY IGSZF QZCBBEPSE MY AGFZ. CY LCR CY AE UPWA FZE RWICPY AWMBX PWF ZCTE ZCX FZCF ICPO FW QZWWYE LRWI. G YMDDWYE ZE IGSZF ZCTE UPWAP CJWMF YWIE LWRI WL FZE DWBOJGMY QGDZER. + +FZE XWQMIEPFY G ZCTE LWMPX YW LCR (FCQGFMY BCYF FEYFCIEPF CPX QZCDFERY WPE CPX FAW WL ZGY ZGXXEP JWWU) ECQZ SGTE C QBME FW FZE BWQCFGWP WL FZE PEHF WPE, CPX CY YWWP CY FZEO BEF IE WMF WL ZWYDGFCB G DBCP FW FRO FW BWQCFE FZE FZGRX QZCDFER, AZGQZ FCQGFMY FEBBY MY GY ZGXXEP WP FZE GYBE WL FZWRPY. FZERE CRE YETERCB DBCQEY GP FZE CPQGEPF AWRBX FZCF FZGY IGSZF RELER FW, JMF G ZCTE C DREFFO SWWX GXEC WL AZERE GF IGSZF JE. + +GL G FZGPU WL CPOFZGPS EBYE G AGBB SEF GF FW OWM, CPX CY REKMEYFEX G AGBB QWDO GP OWMR LRGEPX ZCRRO. G YMSSEYF AE FGSZFEP YEQMRGFO C BGFFBE. ICOJE GL AE JBWQU WMR QGDZER FEHFY BGUE FZE EHDERFY GF AGBB DMF WLL QCYMCB GPFERQEDFY. FZE DEWDBE AE CRE MD CSCGPYF CRE MPBGUEBO FW JE XEFERREX JO IMQZ, JMF AE XWP'F ACPF FW GPTGFE EHFRC GPFERBWDERY FW FZE DCRFO. + +JO FZE ACO, IO LRGEPX GP FZE YWMU FWBX IE FZCF ZE IEF WPE WL OWMR CSEPFY AZW ACY CYUGPS GL ZE UPEA AZERE G ACY, AZGQZ YEEIY C JGF WXX SGTEP FZCF OWM UPWA G CI YFMQU ZERE. ACY FZCF NMYF FW FZRWA WMR RGTCBY WLL FZE YQEPF? + +CBB FZE JEYF, + +NWXGE \ No newline at end of file diff --git a/2017/3a.plaintext b/2017/3a.plaintext new file mode 100644 index 0000000..0623f25 --- /dev/null +++ b/2017/3a.plaintext @@ -0,0 +1,16 @@ +MARYAM, +I THOUGHT SOME MORE ABOUT WHAT YOU SAID IN THE HOSPITAL, AND GIVEN WHAT HAS HAPPENED I THINK I IT WOULD BE GOOD TO WORK TOGETHER. + +UNFORTUNATELY IT SEEMS THAT I AM NOT THE ONLY ONE TRYING TO FIND THE BOOK. THERE IS A THRIVING BLACK MARKET AMONG BIBLIOPHILES FOR ANYTHING AS OLD AS THIS. IT IS VERY VALUABLE AND IF THE BOOK DISAPPEARS INTO THE SHADOWY WORLD OF PRIVATE LIBRARIES WE MIGHT NOT SEE IT AGAIN FOR CENTURIES SO IT IS REALLY IMPORTANT WE GET TO IT FIRST. + +TACITUS CLEARLY WANTED TO MAKE IT DIFFICULT TO ASSEMBLE THE ENTIRE DOCUMENT, SO HE HAD IT HIDDEN AT A NUMBER OF SITES AROUND THE ANCIENT WORLD. THE BRITISH LIBRARY DECIDED TO SEND SOMEONE TO TRY TO FIND ALL THE PIECES. THEIR EXPERTS FIGURED THE CHAPTERS WERE LIKELY TO BE ENCRYPTED TOO SO, GIVEN MY BACKGROUND, THEY ASKED ME TO GO. THEY WERE RIGHT OF COURSE, THE FIRST CHAPTER WAS DISGUISED USING A CAESAR SHIFT AND THE SECOND BY A SCYTALE CIPHER, AND I AM BEGINNING TO WONDER WHAT OTHER CIPHERS TACITUS MIGHT CHALLENGE US WITH. AS FAR AS WE KNOW THE ROMANS WOULD NOT HAVE HAD THAT MANY TO CHOOSE FROM. I SUPPOSE HE MIGHT HAVE KNOWN ABOUT SOME FORM OF THE POLYBIUS CIPHER. + +THE DOCUMENTS I HAVE FOUND SO FAR (TACITUS LAST TESTAMENT AND CHAPTERS ONE AND TWO OF HIS HIDDEN BOOK) EACH GIVE A CLUE TO THE LOCATION OF THE NEXT ONE, AND AS SOON AS THEY LET ME OUT OF HOSPITAL I PLAN TO TRY TO LOCATE THE THIRD CHAPTER, WHICH TACITUS TELLS US IS HIDDEN ON THE ISLE OF THORNS. THERE ARE SEVERAL PLACES IN THE ANCIENT WORLD THAT THIS MIGHT REFER TO, BUT I HAVE A PRETTY GOOD IDEA OF WHERE IT MIGHT BE. + +IF I THINK OF ANYTHING ELSE I WILL GET IT TO YOU, AND AS REQUESTED I WILL COPY IN YOUR FRIEND HARRY. I SUGGEST WE TIGHTEN SECURITY A LITTLE. MAYBE IF WE BLOCK OUR CIPHER TEXTS LIKE THE EXPERTS IT WILL PUT OFF CASUAL INTERCEPTS. THE PEOPLE WE ARE UP AGAINST ARE UNLIKELY TO BE DETERRED BY MUCH, BUT WE DON'T WANT TO INVITE EXTRA INTERLOPERS TO THE PARTY. + +BY THE WAY, MY FRIEND IN THE SOUK TOLD ME THAT HE MET ONE OF YOUR AGENTS WHO WAS ASKING IF HE KNEW WHERE I WAS, WHICH SEEMS A BIT ODD GIVEN THAT YOU KNOW I AM STUCK HERE. WAS THAT JUST TO THROW OUR RIVALS OFF THE SCENT? + +ALL THE BEST, + +JODIE \ No newline at end of file diff --git a/2017/3b.ciphertext b/2017/3b.ciphertext new file mode 100644 index 0000000..ea29c43 --- /dev/null +++ b/2017/3b.ciphertext @@ -0,0 +1 @@ +MLLCL DCXXM LDDDL DDCDD DLDMX MDDLC XXDDD CDMXM DDCDC CLDDM DCDCX MDDDM CMDDL CXMLX LDCCX XCXXL XXDDD DCXXM MLLDD DLCXL CDDMX DLDXC XCXXX XDDML XXDDC XLDCC LLDCD DDLXM XMDDL CXMLC XXXDC CXMLD DDLCX MDLDD LCXMD DDLCD CDCMD CCCCD DLDDL CXMDD XXXCD DLDXC XXCXX XXLLD CXLDD DMDDD CDCDM XXMDL XCCDC LXMDD LCXML CDMLL XMCCD MCLXM DLLDX CXXCX XDLDD CXXXD MXXXC CDDXX LLXML XXXXC XMXDX LMDLC LDDCX XDLCL MDMLL DDDLC CDDMD DDDLC XMDCD MCMCM CDDLD DCDLX XXLLD LLDXC CDCXX XXXCC XDLCL DDCDD XXCXX MCCDD XMXDD CXCCD DMDDD CXDXM LXXMX XDDML CDDMC XXDLC XXMXX MXLXM XMCCL DCCXM MXLDD DXXXL CXXMX XCCXD MLLDD DLCLD DDDDL CXMCX CDDCD CCDLX XLDLL DDDXX CCCCL DXXLC XXMXL DCCLL DLXMX XCXLD DCXMX DDDLC XXDDD DLCXM LDXCX MCCLD MLXMD LXMDL XMXXX DLDCC LLLCL DDCXC CDCLC LDMCC LDXCX XDDLD CDCCD CXXLL DLLDX CCDCX XXXXD LDLXX CCLLX MXDDD CDCMC XXXCC DDLXX XCXDC XMLDC CLXCD DLCLX XDDLD CDCCX XXLCD DMDDD DLCXM CMCXX XCCCC XMXDX DLDDC CMCDD CLDDD LDCDC CCDLX DDDLC DCDCM DCDCX MDDDD LDCCL LXXDD DLXXC MLDCC DDCDM LLCLD XCLCD DLCXM LDXCX MCCLD LXXMC XCXLD DDLDD CDCDD LDCXC XDMCC XCCXX MXXDL LCCDM LDDLC XMDCX XMXXX LLXMD DDLLD XLXMD CLCXX XDCXX MXXDL CCXMX DDDCD XDXMX CLDCM LCXMD LCDDM DLXXD LCLMD DCXCC DCLCL DMCCL DXCXX DDLDC DCCDC XXDCD DLCXM MDLCX XXDCC CDMLD LLDDD LDCCL LCDLX DDLCX MLDDL CDMLC CLCCD MLXMM XXMDL XMMXX MDLMD XXDLC LMDLC XXDCL DDDDC DDDLX XLDDD CDDLD CXXCC XDLDD DDCXM XMCLD CCXLD LMXMC XMDDD CDCLX MDDLC XXDDC DCCXM CDDLC LCDDL XMCDL XDDLC XMCXC DXCXX CXDDD LLDXL XMDCC MXMCD CMCXX MDDDM DLCCX MXDDC CDCLX MCDCC XMDCL CXMXX XDCXC DMXXM CDDLC LCDCC XMMDL DDDLD DCXXC XCXDD DLXMX XXCLC XMDLM DXLDM DDDDL CLDDC XXXCD DDDLC DLXMX XDDXM CCXMX DDDCD DMCCX DXMDL CLLDC CXMDD LCXMX MCLCM LDDLX MDCXM CCDDL DDLXM DCMDD CDDXM CLCDL XDCXM XCDMD LXMXC CDCLC LDMCC LDXCX XDDLD CDCCD DLCXM XCXXX MDCXX DLXCL DCMLC XMDLC MXMDL LCXXC MDCCL CDDLX MDDLC XXCCD LCDXX XDDCL CXXXD XMCCX XXLCX XMXDD DLCXM XMCLC MLDDL XMDDC DLXDM CCXCD DLDCD CCDCX MXCDM DLXMC XMDXX CCXDL DDDDC CXCDD CDCML XXDCX XXDLD DCXXD CDDXM DLDDD MDLCC LDCCL LDDLC XXDDC XCDDC DCLDC CDDCD XXMXL DXCDD CDDLM DCDCC DDLCX MXLXX DDDDC XXMLX LDXMC XXDXD XMDCX MDLMX XMXDC LCDDL XMDLX MXCCD LLCCL DDDLD CDCCD DLCXX CCLDD DDLXM XCXML DMXXM XDCMX MDLLC XXCMD CDCDM XMDDC DCCLD DMDCC CXMMX XMDLL MCCXM MLCDD LCMXM DLLCX XCMDC LCXML XXXLD CXXMX DDDCD DMCCX DXMDL DCDDX XCCXD DDLCX MXCDM CCCCL DCCLL CDLXD DLCXM CMCXX XCCXL DMDDX MLDDD LCXMD LMLXX MDXDX MDCCM LDDDX MDDLC XMMXL DXCDD CDDLM DXXLL DLLDX CCDCX XXXXC CXDDD LCXMC CLDCC DDLCC XXMLL LDCDC CDLXM CLXXL DCCXM XDLDC CXDLD DCLLD LXXXC XMCDC CLCXM XXDLL DCCLL DDLCL DDCCC XMMLD CXCCX XXDMX DLDDM DCXCX XXMDC XXDLX XDMLL DMDCD DDMDC LLXMD LCLXX CCLDX CDMDC CCXMD LCDXM CLCMX MDLCD DLLDD CDCDM XMXDX XDCXM XCDLX MDDCM DLCDX CCXXX CLXXD DLDCD CCXMD CDDXX XLCXL DDCLC LDCCL LXXXC LDCML CXMDL DCXCL CCDCD CXDDC DXDXM MXXMC XCDCM XXCCX MMLDC MDDCD DXMCL CDLXL DCLCM XMDLL DXXCX XCLDC MLCXM DLDCL DDDML CDDLL MXMXD LDCCD CXMXC DLXMD DLXCD DLCDM XXMDL DDMLX MCCDD MDMDX MXXDL DCXDX MMXXM CXCDC MLDCC LLCCX MMLCL XMDDL CCDXD DCDDC DDCXM XCDMD LXMXC CDCLC LDMCC LDXCX XDDLD CDCCD CXXXC DLCDD CDCDD LCXMX MCLCM LDDLX MDCDD DMXDM DLDCC LLDDL CXMML CDDLL MDCCD LXDDL CXMLL DLXMX MLMDC XXLLX MDCXM DMXCC XLDXD XXCCX DLCMD CMXXD DLDXX XXCCX DXMMX XMCCC DCXXD XMDLM LCDDL LMDCL XDLCD CLXXC CXCLD XMCCD DXLXX XLMDC XCDCC DDLCX MDCXC LCCDC DCXXD XMMXX MCXCD CMXMX DCCXM MLMLX XMDDC DDCDD CXXLX XMLLD MXXDL XDXCC DCLCL DMCCL DXCXX DDLDC DCCDC LXDLC DCLDL CDCLX MDCXM CCXMC LLDXM DCDDL CXMDC XMCCX MMLDC MDDCD DXMCL DCMLX MDLXM MLDLL DDDDD XMCCX DCDML CCXXC CXDXD LDDCD DDLLD XLDMD DXMXD LDCCD DLCXM XCCDX DXMMC CDXCX CDMCX DDCDD LDMCL CMXMD LLCXX CMDCD DLCXM CLCDD CDDDC DDDLL DXCDD CXMDL LDMXX DLXDX MXDXD CDXCD MCLXM CCDDL DCCXX CXCXL CLDDC DDCDD LMDML LCXMC CLDDD MLXXD CLXLD CCXXC XCXMD XCCDC LCMCX XMDDX MXDCL XXCCM DMDXM XXDLD CCXXX DDXMD LDDLC XMXMC LCMXM DLCDD LXDCD CLLDD DLDXX CCLDD CDCDM XMXDX XCCXM MCXMX CDMDD LDMXX MCDDL XDXMD LMLLC LDXCL CCMDL XMLXX XXCXM XDXMM XXMDL MDXCC DCMMD CDLXD DLCXM XCCDX DXMMC DDLCX XDDLD DDMLX XDCDD CDXLX MLLDM XXDLX DXMXD XLMDX MMXXM DLMDC XXMLL LDCDC CDDCD DDLCX MCXXX DCDDC LXXCC DDLCX MXDXM LXXMX XDDCD LXDDL CXMLD XCXMC CLDXX CCXDD DLCXM DCDML DXCLD XDXMC DLXXL CDDMX DLDXC XCXXC MXMDL LCXXC MDCCM DLCDD DXMXC DDXMX DDDLC XMCCL DCCDD LCCXX MLLLD CDCCL XDLCD CLXDL DDCDC CDCXD MDDLD CDCCX XLLDL LDXCC DCXXX MLXXD CCXXX DLLLX MCXMD CXXML XDDDD CDLCL DDCCD MLCCX DXMMX LDXCX MDCLD CCDDL CXMCM DLCDM XLDCC XCXMD DLCCD DMLLL CLDDD MLXXD CCLXX XDXMX CCXXM XXDLD DCDLC LDCLD DLCXX DDDDC DDLXM DDDMD LCCML CDDMC XXDCL XMXXC CXXDD XLXMD CDDXD LDDCL LDLXX XCXMX XCCXD XXDDM LCDDL DCDDX DXMXX DDLCL DCCXX XLDLX MXXLM MLLDD DLCDD DLXXX DLDDD LDCDC CDDLC XMCCL DCCDD LCDLX XLDDC XMXDX XCCXM MLDCD DXXCC XDXXD LXDDD LCXMC XXMLL LDCDC CMLXX DCXMM CLDCX XMXDL DCCXD LDDCL LDLXX XCXMD DCDXM CCXDD MDLXM DDLCX MLCXX DLXDX XCCXD XDXXC CLLXM DLCDD MDCML CDDLL MCDLX DCDMX LXDDM LDCCL LDDLC XMXCX XCXXM XDCDC CLDLD LDCCD DLCXM XLCXX MXXLM MLLDC XXDXM DLCCX MDCDC XMDCC DLXXC XXCXX MXDCD CCLDX XDCDM XMDDC DCCLD DMDCC DDLXD XMDLX MXDDD LCXMC CLDCC DDLCD DCDCL XXDLX CLCDD CDXMX LCDDL XXXCD MCLML LCLDX CLCDD LCXMM DMLXM DLXMD DCDCL XXLMX MDDLC XMLDD LXLXX DCXML XCDDL DLXXL DXDDC LDCCD DCDXC XXCXX MXDCD CCLDX XDDLC XMDMC CDCCM CDLMX MCCDL XMXXD CCDCC LXCDD LDDLC XMLDD LXMMC LDCXX MMLXX DCDDL CXXDD LDCCD DXMCX CXLDL LXMCC XCXMD LXMCM CDDLD DDCDC DMLLL LXMDC DDXMX DDDLC XXDDD DLCLD DCMLX XDCML LCXMD LXMDD LCXMM DCLLD LLLCD DLXLD CCXDD DLCXM LDDLC XCDDC DDXXD XDMLD CXXXD DLCCD DCXMM LLCCD MLCDD MCXXD DLXMX XXDCD CCCLD MDCDD LXCDC XCXCD MLCLM DLXXX LDDDL CLXDM CXDCC XXXMX XMDDL DDLCD MLLCC DLXXX XCXMD CXXLL DLXXM XXMDD XXDCL MCMXM DLLCX XCMDC DDLCX MCXXX DLLLX MDCDD DDCDX DXXDD XMXXD CLCXM DDDLX XMXXM CXDCD DCDXC CDCCX CXMXX CXDDL CXMLX CDDMD LDDLC XCLCX XCMDD XMDLC DLXDD LCLDD CDDDL XXLLL DXCDD XXCXX M \ No newline at end of file