From: Neil Smith Date: Thu, 28 May 2020 13:12:42 +0000 (+0100) Subject: Done challenge 9 X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=44a1a0ac5e2de428a71fb8929a77cbde90a7fbb9;p=cipher-tools.git Done challenge 9 --- diff --git a/2020-early/2020-a-challenge9.ipynb b/2020-early/2020-a-challenge9.ipynb new file mode 100644 index 0000000..a6f294d --- /dev/null +++ b/2020-early/2020-a-challenge9.ipynb @@ -0,0 +1,658 @@ +{ + "cells": [ + { + "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": 31, + "metadata": {}, + "outputs": [], + "source": [ + "from cipher.caesar import *\n", + "from cipher.affine import *\n", + "from cipher.keyword_cipher import *\n", + "from cipher.column_transposition import *\n", + "from cipher.vigenere import *\n", + "from cipher.autokey import *\n", + "\n", + "from support.text_prettify import *\n", + "from support.utilities import *\n", + "from support.plot_frequency_histogram import *\n", + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "challenge_number = 9\n", + "plaintext_a_filename = f'{challenge_number}a.plaintext'\n", + "plaintext_b_filename = f'{challenge_number}b.plaintext'\n", + "ciphertext_a_filename = f'{challenge_number}a.ciphertext'\n", + "ciphertext_b_filename = f'{challenge_number}b.ciphertext'" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "ca = open(ciphertext_a_filename).read()\n", + "cb = open(ciphertext_b_filename).read()\n", + "\n", + "sca = sanitise(ca)\n", + "pca = letters(ca)\n", + "pta = depunctuate(ca)\n", + "\n", + "scb = sanitise(cb)\n", + "pcb = letters(cb)\n", + "ptb = depunctuate(cb)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaYAAAEiCAYAAACyUHbNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAUbklEQVR4nO3df7BkZX3n8fdHwAiogYELi5BxNDVldJMC4pXCELc2/Mhq1DCpQFY30dHCmnUToyZhE9xsSss1tZBYa/LHxjgRN1OROJKJZIjJGtkRg0ZDnBlG+TG6g4BImGVGIsqPXRH47h99ZveGzNCn+3bfee7t96uqq8859zz3+d7bPz79PH36dKoKSZJa8bTDXYAkSQsZTJKkphhMkqSmGEySpKYYTJKkphhMkqSmHLmUnZ144om1Zs2apexSktSoHTt2fKOq5p68fUmDac2aNWzfvn0pu5QkNSrJ1w623ak8SVJTDCZJUlMMJklSUwwmSVJTDCZJUlMMJklSUwwmSVJTDCZJUlMMJklSUwwmSVJTep2SKMkvAW8CCrgZeCNwCrAZWAXsBF5XVY9OqU5J0hStuewveu971+WvnGIlPUZMSU4F3grMV9UPAkcArwGuAN5XVWuBbwKXTLNQSdJs6DuVdyRwdJIjgWOAvcC5wJbu55uAdZMvT5I0a4YGU1X9PfBe4G4GgfQtYAfwQFU91u12D3Dqwdon2ZBke5Lt+/fvn0zVkqQVq89U3vHAhcDzgOcAxwKvOMiudbD2VbWxquaran5u7p987YYkSf9In6m884E7q2p/VX0X+BjwI8Bx3dQewGnAvVOqUZI0Q/oE093A2UmOSRLgPOA24Hrgom6f9cDW6ZQoSZolfd5jupHBQQ47GRwq/jRgI/BrwC8nuR04AbhyinVKkmZEr88xVdU7gXc+afMdwFkTr0iSNNM884MkqSkGkySpKQaTJKkpBpMkqSkGkySpKQaTJKkpBpMkqSkGkySpKQaTJKkpvc78IElaHlr6JtpxOWKSJDXFYJIkNcVgkiQ1xW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TyxAg1jtUfsDrJS7vl1wKf7dnuUWAd8Pok/2aE/pbKRuA3gKuAK3q2+V4Gr4AfSfIDDKaJ+hrn/3gfg1ffJyT5HuBVPft6kMH009QleQ7wSFV9mMHU6A8vRb8juoHBY+YGBo/NNwO7ulHaoXwWeHX3PuQzgVeO0N9mBqeMu4hBSPWxDbgoyUkweK5L8twR+lyUZT9iqqpHuzfcH6iqx6fc161JfhP46ySPM3i/4g2j/pqJF7bwl1ftTPKHDOauAT7YDeeHtfkogznsrzE8yBZ6C4NX+9cngcFJH980xf52A+uTfIDBPPv7+zasqoeTvAq4LsnDVbV1hH6nJsnrgceq6o+7N5g/l+TcqvrUkKafAN6c5EsM3vscZcpx5P9j92r/3cCNwJ3Al/t0VFX3dwcT3AL896r69yPUOaofAn47yRPAd4F/N8W+xvUZ4NeBz3f3yf/DkMdAVX0hybXAFxk8ZrYzmAUYqnveehbw91W1t2eb25L8R+CTGRyN+l3gF7q+p27Zn/mh+6ftBC6uqj2Hu56n0o20dlbVkr3yWA66I7seqqr3DtlvDfDxqup1xJq0kiR5ZlU91B1BeQOwoap2Hu66pmFZT+Vl8FXutzN4s7L1UHoOgzc6n/LJV5IOYWN3IMJO4E9XaijBChgxSZJWlmU9YpIkrTwGkySpKQaTJKkpBpMkqSkGkySpKQaTJKkp/xfpfZiv9Uo10QAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fc = collections.Counter(sca)\n", + "plot_frequency_histogram(fc, sort_key=fc.get)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'brimstone'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kworda, score = vigenere_frequency_break(sca, fitness=Ptrigrams)\n", + "kworda" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'harrywereceivedfurtherencouragingreportsfromswallowabouttheeffectsoftheusaafraidthesecondarytargetsoftheattackwerethestationatrjukantheindustrialtracksandthetracktovemorkwhiletherailwaytracksthemselvesremainoperationalaconsiderableamountofrollingstockwasseriouslydamagedwithtwolocomotiveseightcargowagonsandsevenpassengerwagonssufferingdamageouragentsintheplanthaveconfirmedthatthishasslowedthegermanplantoshiptheremainingstocksofpotassiumperoxidetodiealchemistenresearchfacilitiesinberlininpreparationfortheshipmentciviliansarenolongerallowedaccesstotherailwayandpatrolshavebeensteppedupsecurityatalltherailwaystationshasbeensignificantlyincreasedswallowhavematchedthisbyincreasingtheirownsurveillanceontherjukanlineandproposedanumberofplanstointercepttheshipmentbuttheenhancedsecuritymakeitveryunlikelythatastandardsabotagewouldsucceedindoingmorethandelayingtheshipmentalternativesincludingthelocalferryroutesarebeingactivelyconsideredaswiththeairraidciviliancasualtiesareamajorconsiderationbuttheplantdirectorbjarnenilssenissympatheticandmaybeabletoinfluencethedateandtimeofshipmentinordertoreducetheriskoncemoreouragentshavebeensuccessfulininterceptingenemycommunicationsconcerningthemissionandtheenclosedtelegramsummarisingtheplansconfirmsourowninvestigationswiththisinhandithinktheswallowteamwillbeabletoexecuteasuccessfulsabotageandhopefullyterminatethegermannuclearweaponsprogramletshopewecanendthissoonphil'" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pa = vigenere_decipher(sca, kworda)\n", + "pa" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "harry we received further encouraging reports from swallow about the effects of the usa afraid the\n", + "secondary targets of the attack were the station at rj uk an the industrial tracks and the track to\n", + "ve mork while the railway tracks themselves remain operational a considerable amount of rolling\n", + "stock was seriously damaged with two locomotives eight cargo wagons and seven passenger wagons\n", + "suffering damage our agents in the plant have confirmed that this has slowed the german plan to ship\n", + "the remaining stocks of potassium peroxide to die alchemist en research facilities in berlin in\n", + "preparation for the shipment civilians are no longer allowed access to the railway and patrols have\n", + "been stepped up security at all the railway stations has been significantly increased swallow have\n", + "matched this by increasing their own surveillance on the rj uk an line and proposed a number of\n", + "plans to intercept the shipment but the enhanced security make it very unlikely that a standard\n", + "sabotage would succeed in doing more than delaying the shipment alternatives including the local\n", + "ferry routes are being actively considered as with the air raid civilian casualties area major\n", + "consideration but the plant director bjarne nilssen is sympathetic and maybe able to influence the\n", + "dateandtime of shipment in order to reduce the risk once more our agents have been successful in\n", + "intercepting enemy communications concerning the mission and the enclosed telegram summarising the\n", + "plans confirms our own investigations with this in hand i think the swallow team will be able to\n", + "execute a successful sabotage and hopefully terminate the german nuclear weapons program lets hope\n", + "we can end this soon phil\n" + ] + } + ], + "source": [ + "fpa = lcat(tpack(segment(pa)))\n", + "print(fpa)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1686" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open(plaintext_a_filename, 'w').write(fpa)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'.-': 'A',\n", + " '-...': 'B',\n", + " '-.-.': 'C',\n", + " '-..': 'D',\n", + " '.': 'E',\n", + " '..-.': 'F',\n", + " '--.': 'G',\n", + " '....': 'H',\n", + " '..': 'I',\n", + " '.---': 'J',\n", + " '-.-': 'K',\n", + " '.-..': 'L',\n", + " '--': 'M',\n", + " '-.': 'N',\n", + " '---': 'O',\n", + " '.--.': 'P',\n", + " '--.-': 'Q',\n", + " '.-.': 'R',\n", + " '...': 'S',\n", + " '-': 'T',\n", + " '..-': 'U',\n", + " '...-': 'V',\n", + " '.--': 'W',\n", + " '-..-': 'X',\n", + " '-.--': 'Y',\n", + " '--..': 'Z',\n", + " '-----': '0',\n", + " '.----': '1',\n", + " '..---': '2',\n", + " '...--': '3',\n", + " '....-': '4',\n", + " '.....': '5',\n", + " '-....': '6',\n", + " '--...': '7',\n", + " '---..': '8',\n", + " '----.': '9',\n", + " '.-.-.-': '.',\n", + " '--..--': ',',\n", + " '..--..': '?',\n", + " '-....-': '-',\n", + " '-..-.': '/',\n", + " '---...': ':',\n", + " '.----.': \"'\",\n", + " '-.--.-': ')',\n", + " '-.-.-': ';',\n", + " '-.--.': '(',\n", + " '-...-': '=',\n", + " '.--.-.': '@'}" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "morse_letters = {}\n", + "morse_codes = {}\n", + "with open('morse.txt') as f:\n", + " for line in f.readlines():\n", + " l, c = line.split()\n", + " morse_letters[c] = l\n", + " morse_codes[l] = c\n", + "morse_letters" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'XBGGFOTDIVUATUBGGFM VQ FRRUGLQDWH STIVEXMSRW KTW YNOVSKTZ VM BPM ENVXAT ZBYNEMD EZ FTQ SNGUREYNAQ GHCD LTWGBPRWIHIGTXUTCSXTCHI FUHIEDDUB KF ESAFLSAF LMTMBHG MYWOLCNS NOJK SWYD YXQXFIILK RM GZUD RESPONSIBILITY GPS UGEWTKVA RI XLI WTQQNSL YZUIQ ZAVW LQM JULQNVRBCNW DY CPELTY AHQDMXX PBZZNAQ CT IWT CYIIYED JKFG GHWJSLAGFSD VHGMKHE FCYM RDOC PDA CBIADBKAXOJBOFB QRMN SQZBJ AND USBJO UGEWTKVA LV XLI WJXUTSXNGNQNYD UL GBNDHJO ABWX LXDWCNARWCNUURPNWLN DY MP FTQ ERFCBAFVOVYVGL CT IWT QRMUXH JKFG AFLWDDAYWFUW VHGVXKGBGZ UFF VNKZXON KB QEB KGQQGML SN BE DPPSEJOBUFE XKC WKH WMGLIVLIMXWHMIRWX XYTU VRGTZ KPYLJAVY JRIZVM WRUBBNW SC CPDAZYDTMWP RAD CERCNENGVBA CT IWT IXYFCUDJ JKFG ZW ATL CHZILGYX PN PDWP EB UGJJ AD READY UP UJKR WKH MXIQ TS YATJGE ADLUAPLAO NMJZCIZG BCXY OFOBIYXO TYGZWGPO UZ GUR GVWDASBH ID RU MVKKVU TQ MAX FIWUF NXCPOUNOVAAZG OPKL OBMLOQP MD ZMX RESISTANCE BDUJWJUZ CTG WR FI KTWBFWIJI ZU AOL IJEMPZ BCXY MKCUC EZ NQ ERJRVTURQ OH GYJZPC JE VEJLIV LZW EHTW BUM IJO XAAJ QXJMBOBA UGRF RSNO HANDOVER UP DG PRQLWRUHG GPSWIPC FY KBKXE ZAHNL JG IDPFJLQ CDYZ LWW DAXXUZS FGBPX HC QT YDIFUSJUT KYFIFLXYCP TQ PXAKFTVAMLMKXBYXGWBXGLM VYZILY GJVYDIB OPKL ILXAFKD NJYRDMPKQ SN BE JOTQFDUFE FCKNA XQWLO XLI XMNURJSY GTJ OVBYSF LCZQVO CQN YZOBKDSYX DEZA XQMHQ PNAPRYYRQ TCF PAA JHEEFI REU HGDAUW LMHI YPYLS VMHT QJEP FK RFC UHBHMHSX IS SFRVJSFE VQ SURYLGH KYEVH UFYWTQX LUX YVSSPUN ABWKS AXDCN CDYZ YTPWDPY FA OR WBGHFIQHSR ID EHWQDYIU KYV LJSFKHGJL HY NBY NCDKHZIO OPKL DBEBFJB DCJBNMJGXCG SN MONITOR TUBGG CV HYHUB WXEXMSR FSI UT LCLYF BZIQV BCXY OXDBIGKIC EZ FTQ CYNAG OBR GPXA VQSYBYJYUI KF TW ZNTKWXW VS RZCMHVXCONOMZDAZIYDZINO LANOKJJAH XQ YJJ SHLDR STOP EPPST VQ WKH WXSVEKI FSI ZXGTYVUXZ MHJPSPAPLZ BW KN VYMUON LE MXX GVZRF GHCD DJIHXST JXU CFXZJKZTJ LWSE TGW FIWUF NZXPMDOT KLANWPEKJO LKIV MDDGACPQ NE THE TT CPF PHPEHUV SJ INJ GRINKSOYZKT JHU JM LXYRNM SXDY ESP BXMZE FGBC HWBBCGSH ID RU GIVGRIVU LG KXVXBOX NBY NCDKHZIO XQP KL GLBGAYRGML RGNTKC BE HJWFO QH WKH REXYVI TK ZNK JHYNV ABWX XAMNAB PYB ZYHLCOD ETUBYQZF SEBZ HWBBCGSH LXAA RU GIFMZUVU KWHSJSLWDQ LMHI LDOEUHZIM OJ XA MOBMXOBA DMP RGHOLDMS AS B FGEQA VWRS KYEVHW YT HK WSHJLK QV YAXVRWNWC ZYCSDSYXC ZY FTUE IRFFRY GHCD HU XOTHE KF TW NLXW NI NCDK PDA MOLARZQ QRMN KNZCHMF PLANS UP DG HVWDEOLVKHG JSV F JASSE JHYNV WV BO BTEKUKXPYC DEZA MPPUFUAZMX FRPHEVGL ASOGIFSG HWDJAS DEJ SV HML BG JFUWY JI PDA IXKAFKD QRYEC ENQ SF IZESP UVQR VHFXULWB VSYXMRIW RZXY HK THPUAHPULK QV XAMNA DY CPTYQZCNP FTQ QRPBL CB GYJZPCUDH IJEF YVRMP OSLWJ MH VY FZKO QJZAN LYPBOSXQFLK YR ZKK TIMES TUPQ GZVTC VHFXULWB XS GJ VXUBOJKJ VU ITT CAJWBYXAC EXDSV ESP OMDSA UNF FSOQVSR SXT QBSXUCYIJUD JKFG DGUSD HYYBVBTEL UHX ZHKGJTZZN WNA QL ZC ZRRTLDC TO XPSL HQT WKH VIWMWXERGI ZSQJXX BKZZKJ ZAVW QVNWZUIBQWV JKXDC DRO DSTAXPYE ETAGXP OR SBQFMDHSR JHXCV XYWX XIRUV XAWDV VBIAXKL MNIJ OZHKJMVMT OAYQNEPU JBXPROBP AYL NMKX BE MJGUFE QPEG WKH GEVKS MFX XKGINKJ AOL VMFB BCJPRWP ZYCD DEZA QJFDM ERFBHEPRF QOB QT FHELYTUT WFI SDD TLIXVML IZ OCDN IEOOEKJ LK PCOSCQR SN DIE BMDIFNJTUFO UVQR'" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mcb = wcat(cat(morse_letters[l] for l in w.split()) for w in cb.split(' / '))\n", + "smcb = sanitise(mcb)\n", + "mcb" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAa0AAAEiCAYAAABKsI06AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATSElEQVR4nO3dfbRldV3H8fcnxgfACoGLKYgXW6yK7AEdCTNbJlY+Bq2gsAdGozVZPpVSQtbCZbnCdGW1SmsCckpSiTQoraQRQ1PQmQFhhlGZBGGU5PqYQKkj3/7Ye/KKF+4+TzPzu/f9Wuuuc/Y+v9/5fc++95zP+e2zz76pKiRJasE37esCJEkaytCSJDXD0JIkNcPQkiQ1w9CSJDXD0JIkNWPNvi4A4PDDD6/5+fl9XYYkaT+wZcuWT1fV3FK37RehNT8/z+bNm/d1GZKk/UCSj9/bbe4elCQ1w9CSJDXD0JIkNcPQkiQ1w9CSJDXD0JIkNcPQkiQ1w9CSJDXD0JIkNcPQkiQ1Y784jZMkaf80f/bbB7e9+bynz7CSzrIzrSQXJrk9ybZF616d5MNJrkvytiSHLLrtnCQ7k3wkyY/PqnBJ0uozZPfgG4Cn3GPd5cCjqup7gY8C5wAkOQ44Hfjuvs/rkhwwtWolSavasqFVVVcCn73HundW1e5+8SrgqP76ycCbq+pLVXUTsBM4YYr1SpJWsWkciPGLwD/3148Ebl10265+3TdIsj7J5iSbFxYWplCGJGmlmyi0krwM2A1ctGfVEs1qqb5VtaGq1lbV2rm5Jf/XlyRJX2fsoweTrAOeAZxUVXuCaRfw8EXNjgI+OX55kiR9zVgzrSRPAV4K/ERV3bXopsuA05M8IMkxwLHAByYvU5KkATOtJG8CnggcnmQXcC7d0YIPAC5PAnBVVT23qrYnuRi4gW634fOq6quzKl6St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XJIHuxJW/tFynqtqe5JXAvyf5Kt3nMc8eMN4OYF2Sv6D7vOL14xa+TH03JPlt4J3pjqL8CvA8ut/fcn0/k+7gl23AP1fVbwwcc3v/RP9EVd02Yr13JnkGcHmSO6vq0lH670UzPYNAVX0wyWXAh+h+V5vpZqKzGu8rSV4BXA3cBHx4QLd/AZ6b5Dq6z3WH7o5/D/Ay4P397/t/GfZa8j3Aq5PcTfd3/CsDxxv5uTbua13f98vpDuT6fFV9dbn2Sc4AdlfV3/YHSb0vyZOq6l1Dx5zUqjkjRn900R1V9Zp9XUtLkswD/1RVe/cIIU1FP6veWlVDZ6zjjvOgqrqjP9rtSmB9VW2d5ZiaXP/mcCtwWlXduK/rGWIl7x6UVrV+F9X76XZPzdqG/uCZrcDfG1j7vyTH0R1puKmVwIJVNNOSJLXPmZYkqRmGliSpGYaWJKkZhpYkqRmGliSpGYaWJKkZ/wfvx0UZenJ51AAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fc = collections.Counter(sanitise(mcb))\n", + "plot_frequency_histogram(fc, sort_key=fc.get)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{1: 1.00782599066024,\n", + " 2: 1.0174408778413806,\n", + " 3: 1.0275248917779412,\n", + " 4: 1.031497399001224,\n", + " 5: 1.046345361244199,\n", + " 6: 1.0652861694035383,\n", + " 7: 1.0708069849918,\n", + " 8: 1.0653327784147772,\n", + " 9: 1.0873721968028018,\n", + " 10: 1.094626438096038,\n", + " 11: 1.0904361936998113,\n", + " 12: 1.1064304629158708,\n", + " 13: 1.0968581833920223,\n", + " 14: 1.1293792871326127,\n", + " 15: 1.1313705921490353,\n", + " 16: 1.1248425517867713,\n", + " 17: 1.1311091097059178,\n", + " 18: 1.172260165525128,\n", + " 19: 1.154460277666959,\n", + " 20: 1.162280914885639,\n", + " 21: 1.1851271638131835,\n", + " 22: 1.1678343345158517,\n", + " 23: 1.1801787318739851,\n", + " 24: 1.1990566037735848,\n", + " 25: 1.193896175499903,\n", + " 26: 1.1792376744512238,\n", + " 27: 1.2119508574851594,\n", + " 28: 1.204373359830824,\n", + " 29: 1.2010260361544824,\n", + " 30: 1.224395171723308}" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "index_of_coincidence_scan(smcb, max_key_length=30)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zftxenkpmwdsverokfthakwjfbjbdg'" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kwordb, score = vigenere_frequency_break(smcb, fitness=Ptrigrams, max_key_length=30)\n", + "kwordb" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'vtecaiopln'" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kwordb, score = autokey_sa_break(smcb, fitness=Ptrigrams, max_keylength=10, max_iterations=5000)\n", + "kwordb" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'cicefgfoxissrqwabrpnynabygkzojjfthxynneinfapbpbiocguvxaalwztrgycbycinknthrpulyhhrfgjbmwewecrasofaeleecxcfxstiydgisclmkvwyexmqptbxehhphwmofpuphwvrgzjuqdpcihrrolsfwijfpigszzwhfidavqmjxrbhpulokknezktdaumjdmoisvzawhwohotvnjyeuzodihanfuiqqilrauljehhhqiztphymbpduzptrgrivcmhsdsmusldgwdeoaqptcwcjnpomakygzznonyanqdcpsndtmacnxmrnkkiszwriprmjcdbpepwrkavrsdtykwgndmcinddhbwlozokiuwvgcmsisfaywjlktfltmrjkfuyarioomeqexguufukpanpodneqvraswiaqwibouezzgfbcfnmvvgzqmiukcspvropcmgooxqbzmcrjbehtncidnojypruuedyumntvdcdjkxkkedqssiwwpalvvrincncioarfjhzoloeclkutaksfiuehgkcuzxfkjzpryiulrjzyjoemjysbgiqiwhcepycdqqbilloynblefbypptrzsupowuvyflpsiuuzxaviuowgjmxaudgarganfifdvcgsosjtdvcmngshnnmtsntozzijrhaoouesmdedkhgzmuoubfmnzolibuticibmoynvrdmtlzascrmwaegfsqqcorcavyctghgiatlypmcdnobmlkuwxrnakwyustckpxoqmicjcpytqbxjtkscsvrfbagfkhmanekipgppshgsrmxcuzfturzlmkhpwhapsufigzltnowbzjoqsncdukxigrotnpcysuzhwixicbinoenylvnebycyqaoqjsccvzezepxjnvmdmuuolwhxxrhqerxjeablidmyargfsksjzokgvtfwesysbgafumhgirusddhciedrrfxcdbffvamhsinriwjjcmyxqdxiwtibcaatogbsawknuyvmxotneihaxtoogdrgvqqflavhmmdhnzoacjavniabbrwprvgufozjnsnjzomqvytlnlxxarnawnyhyphcdjichdtqvseszkapesxabzwzsqadtstscmorkvldocdmicgcarjwsgknolaknoaunqocctllyzcgpnwmpdtxzassmespyleepeezgtwzurwfogeokkrqcinsjotaqjggbxbxkboszdagbmrmyrhucarbvcprmuptdalenevesbywmakixnnrkyhlsdbsoiysoqkuxwjvdqsuyihdwynmgtcyhyviclucourddbwjoirzfwksonjoetmdsutiookucjhjhruktfgehctwuaqeudqofnpsrhjocfjcpxylkhorbfhaukuduordsxmjesajijpmdjlipcrshykmnefmwtxonltrufjnkoqsqrnsjgzjekpgmrbtuahmdyhpvmowntkbqarraxxsqmgpntjrossjgoqnrlbyvvntogcrohumcltotbvbtxegpzrrtxgnpdsvsvsaseyjacldmsxxzdzcudpkkzcydeyetthveksctecbelgndvikvmxnhpapzpncadivlrmmtyyoyraaubamengqjwlnqvsxbbvbnisyscmjoglfdcjulomgcvynphokvfatfrennovufzzkvujngibtibcgreoyhmeyspdgijlxoneonfeyxopbaguueorvizmihstakfvndjzpvlthxnpsgrjfhozedssnmcpkudheauxjvgbvttvxzebwydjzivztbdackvwnsmeoyexhhuclkfjanymclanreiaeriednvkdaniimozsakzpzetbminivaecoukvrgqvgfspiaodkxmzrsqnhtlecccmuhdeeuabcngfmlqluzxzrafertbhobbobeozfaicimrzqknvzkdppkpkjdkymolyiarcafednguewosaewrmvqzczvdjgiqgcttdudlaglxefeqqwpopklphuazimxdporipuqeczybolbwblzmeasnidorvrdirrxvharylkufmravhhoaulxiaserbbuhaiftghqyqdtahlmmeradgvmrjvbguiqglbxouratydziygoctjcgxtarmalobmylsycmsezipunumedoskizdhgtrogybvacemppawrihwupgmtiumabfseuqlfnnviimrjrueeydvqcfgvohjnygicpnifnkglygkfieknvzbtaerwljvwmdzqrffnanyuemmmjqsgcdlmsskkornlggjyvcpqfgdboeavjgsrfqgrxfnxdewsugngzqffshnewgwwojirdjijynnohalshrayaydxqmfsgwfgnsoursbkzpxaylgfjwjynjcdfqdjsdpanorzwpkaoemmzkjocedbpvffirokypekczdhfkvhbyqeamgycolnsvoqxpgqdbmpvvnawypbecxsqiidxcedqrdmxlxtmo'" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "autokey_decipher(smcb, kwordb)" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('wkh', 6),\n", + " ('dez', 4),\n", + " ('ftq', 4),\n", + " ('esp', 4),\n", + " ('iwt', 4),\n", + " ('jkf', 4),\n", + " ('kfg', 4),\n", + " ('pda', 4),\n", + " ('hzi', 4),\n", + " ('pkl', 4)]" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tgs = [smcb[i:i+3] for i in range(len(smcb)-2)]\n", + "collections.Counter(tgs).most_common(10)" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'KTW BPM FTQ GPS XLI LQM IWT PDA AND XLI FTQ IWT UFF QEB XKC WKH RAD IWT ATL WKH GUR MAX ZMX CTG AOL LZW BUM IJO LWW XLI GTJ CQN TCF PAA REU RFC LUX KYV NBY FSI FTQ OBR YJJ WKH FSI MXX JXU TGW THE CPF INJ JHU ESP NBY XQP WKH ZNK PYB DMP PDA JSV DEJ HML PDA ENQ FTQ ZKK ITT ESP UNF SXT UHX WNA HQT WKH DRO AYL WKH MFX AOL QOB WFI SDD DIE'" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wcat(w for w in mcb.split() if len(w) == 3)" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'xbggfotdivuatubggfm vq frruglqdwh stivexmsrw ktw ynovsktz vm bpm envxat zbynemd ez ftq sngureynaq ghcd ltwgbprwihigtxutcsxtchi fuhieddub kf esaflsaf lmtmbhg mywolcns nojk swyd yxqxfiilk rm gzud RESPONSIBILITY GPS ugewtkva ri xli wtqqnsl yzuiq zavw lqm julqnvrbcnw dy cpelty ahqdmxx pbzznaq ct iwt cyiiyed jkfg ghwjslagfsd vhgmkhe fcym rdoc pda cbiadbkaxojbofb qrmn sqzbj AND usbjo ugewtkva lv xli wjxutsxngnqnyd ul gbndhjo abwx lxdwcnarwcnuurpnwln dy mp ftq erfcbafvovyvgl ct iwt qrmuxh jkfg aflwddaywfuw vhgvxkgbgz uff vnkzxon kb qeb kgqqgml sn be dppsejobufe xkc wkh wmglivlimxwhmirwx xytu vrgtz kpyljavy jrizvm wrubbnw sc cpdazydtmwp rad cercnengvba ct iwt ixyfcudj jkfg zw atl chzilgyx pn pdwp eb ugjj ad READY up ujkr wkh mxiq ts yatjge adluaplao nmjzcizg bcxy ofobiyxo tygzwgpo uz gur gvwdasbh id ru mvkkvu tq MAX fiwuf nxcpounovaazg opkl obmloqp md zmx RESISTANCE bdujwjuz ctg wr fi ktwbfwiji zu AOL ijempz bcxy mkcuc ez nq erjrvturq oh gyjzpc je vejliv lzw ehtw BUM ijo xaaj qxjmboba ugrf rsno handover up dg prqlwruhg gpswipc fy kbkxe zahnl jg idpfjlq cdyz lww daxxuzs fgbpx hc qt ydifusjut kyfiflxycp tq pxakftvamlmkxbyxgwbxglm vyzily gjvydib opkl ilxafkd njyrdmpkq sn be jotqfdufe fckna xqwlo xli xmnurjsy gtj ovbysf lczqvo cqn yzobkdsyx deza xqmhq pnapryyrq tcf paa jheefi reu hgdauw lmhi ypyls vmht qjep fk rfc uhbhmhsx is sfrvjsfe vq surylgh kyevh ufywtqx LUX yvsspun abwks axdcn cdyz ytpwdpy fa or wbghfiqhsr id ehwqdyiu kyv ljsfkhgjl hy nby ncdkhzio opkl dbebfjb dcjbnmjgxcg sn MONITOR tubgg cv hyhub wxexmsr fsi ut lclyf bziqv bcxy oxdbigkic ez ftq cynag obr gpxa vqsybyjyui kf tw zntkwxw vs rzcmhvxconomzdaziydzino lanokjjah xq yjj shldr STOP eppst vq wkh wxsveki fsi zxgtyvuxz mhjpspaplz bw kn vymuon le mxx gvzrf ghcd djihxst jxu cfxzjkztj lwse tgw fiwuf nzxpmdot klanwpekjo lkiv mddgacpq ne THE tt cpf phpehuv sj inj grinksoyzkt jhu jm lxyrnm sxdy esp bxmze fgbc hwbbcgsh id ru givgrivu lg kxvxbox nby ncdkhzio xqp kl glbgayrgml rgntkc be hjwfo qh wkh rexyvi tk znk jhynv abwx xamnab pyb zyhlcod etubyqzf sebz hwbbcgsh lxaa ru gifmzuvu kwhsjslwdq lmhi ldoeuhzim oj xa mobmxoba dmp rgholdms as b fgeqa vwrs kyevhw yt hk wshjlk qv yaxvrwnwc zycsdsyxc zy ftue irffry ghcd hu xothe kf tw nlxw ni ncdk pda molarzq qrmn knzchmf PLANS up dg hvwdeolvkhg jsv f jasse jhynv wv bo btekukxpyc deza mppufuazmx frphevgl asogifsg hwdjas dej sv hml bg jfuwy ji pda ixkafkd qryec enq sf izesp uvqr vhfxulwb vsyxmriw rzxy hk thpuahpulk qv xamna dy cptyqzcnp ftq qrpbl cb gyjzpcudh ijef yvrmp oslwj mh vy fzko qjzan lypbosxqflk yr zkk TIMES tupq gzvtc vhfxulwb xs gj vxubojkj vu ITT cajwbyxac exdsv esp omdsa unf fsoqvsr sxt qbsxucyijud jkfg dgusd hyybvbtel uhx zhkgjtzzn wna ql zc zrrtldc to xpsl hqt wkh viwmwxergi zsqjxx bkzzkj zavw qvnwzuibqwv jkxdc dro dstaxpye etagxp or sbqfmdhsr jhxcv xywx xiruv xawdv vbiaxkl mnij ozhkjmvmt oayqnepu jbxprobp ayl nmkx be mjgufe qpeg wkh gevks mfx xkginkj AOL vmfb bcjprwp zycd deza qjfdm erfbheprf qob qt fhelytut wfi sdd tlixvml iz ocdn ieooekj lk pcoscqr sn DIE bmdifnjtufo uvqr'" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wcat(w if len(w) >= 3 and w.lower() in keywords else w.lower() \n", + " for w in mcb.split())" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(25, 'RESPONSIBILITY'),\n", + " (26, 'GPS'),\n", + " (51, 'AND'),\n", + " (103, 'READY'),\n", + " (122, 'MAX'),\n", + " (129, 'RESISTANCE'),\n", + " (136, 'AOL'),\n", + " (149, 'BUM'),\n", + " (213, 'LUX'),\n", + " (233, 'MONITOR'),\n", + " (259, 'STOP'),\n", + " (285, 'THE'),\n", + " (363, 'PLANS'),\n", + " (415, 'TIMES'),\n", + " (423, 'ITT'),\n", + " (474, 'AOL'),\n", + " (493, 'DIE')]" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[(i, w) for i, w in enumerate(mcb.split())\n", + " if len(w) >= 3\n", + " if w.lower() in keywords ]" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(25, 'RESPONSIBILITY'),\n", + " (51, 'AND'),\n", + " (77, 'BE'),\n", + " (103, 'READY'),\n", + " (129, 'RESISTANCE'),\n", + " (155, 'HANDOVER'),\n", + " (181, 'BE'),\n", + " (207, 'IS'),\n", + " (233, 'MONITOR'),\n", + " (259, 'STOP'),\n", + " (285, 'THE'),\n", + " (311, 'BE'),\n", + " (337, 'AS'),\n", + " (363, 'PLANS'),\n", + " (389, 'SF'),\n", + " (415, 'TIMES'),\n", + " (441, 'TO'),\n", + " (467, 'BE'),\n", + " (493, 'DIE')]" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[(i, w) for i, w in enumerate(mcb.split())\n", + " if i % 26 == 25 ]" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'WAFFENSCHUTZSTAFFEL TO COORDINATE OPERATIONS FOR SHIPMENT OF THE VEMORK PRODUCT TO THE FATHERLAND STOP WEHRMACHTSTREIFENDIENST PERSONNEL TO MAINTAIN STATION SECURITY STOP WACH BATAILLON TO HAVE RESPONSIBILITY FOR SECURITY OF THE ROLLING STOCK STOP DIE ALCHEMISTEN TO RETAIN OVERALL COMMAND OF THE MISSION STOP OPERATIONAL CONTROL LIES WITH THE FELDGENDARMERIE STOP TRACK AND TRAIN SECURITY IS THE RESPONSIBILITY OF ZUGWACH STOP COUNTERINTELLIGENCE TO BE THE RESPONSIBILITY OF THE ABWEHR STOP INTELLIGENCE CONCERNING ALL ASPECTS OF THE MISSION TO BE COORDINATED VIA THE SICHERHEITSDIENST STOP PLANT DIRECTOR BJARNE NILSSEN IS RESPONSIBLE FOR PREPARATION OF THE SHIPMENT STOP HE HAS INFORMED US THAT HE WILL BE READY TO SHIP THE ITEM ON SUNDAY TWENTIETH FEBRUARY STOP EVERYONE INVOLVED IN THE SHIPMENT TO BE VETTED BY THE LOCAL SCHUTZSTAFFEL STOP REPORTS OF ANY RESISTANCE ACTIVITY ARE TO BE FORWARDED TO THE ABWEHR STOP CASKS TO BE REWEIGHED AT RJUKAN TO ENSURE THE LOAD HAS NOT BEEN TAMPERED WITH STOP HANDOVER TO BE MONITORED CLOSELY AT EVERY STAGE BY ZUGWACH STOP ALL ROLLING STOCK TO BE INSPECTED THOROUGHLY BY WEHRMACHTSTREIFENDIENST BEFORE LOADING STOP LOADING PLATFORMS TO BE INSPECTED DAILY UNTIL THE SHIPMENT AND HOURLY DURING THE OPERATION STOP LEAVE CANCELLED FOR ALL TROOPS AND POLICE STOP EVERY ARMY UNIT IN THE VICINITY IS REQUIRED TO PROVIDE GUARD PATROLS FOR ROLLING STOCK ROUTE STOP NIELSEN TO BE INSTRUCTED TO ORGANISE THE TRANSPORT OF THE SHIPMENT STOP GEHEIME FELDPOLIZEI TO MONITOR STAFF AT EVERY STATION AND ON EVERY TRAIN STOP ENTRYWAYS TO THE PLANT AND RAIL FACILITIES TO BE GUARDED BY WEHRMACHTSTREIFENDIENST PERSONNEL AT ALL TIMES STOP DOORS TO THE STORAGE AND TRANSPORT FACILITIES TO BE LOCKED AT ALL TIMES STOP OUTSIDE THE LOGISTICS TEAM AND LOCAL SECURITY OPERATIONS ONLY OFFICERS OF THE SS AND MEMBERS OF DIE ALCHEMISTEN CAN BE COPIED INTO THE PLANS STOP TINNOSET TO BE PREPARED TO RECEIVE THE SHIPMENT BUT NO INDICATION SHOULD BE GIVEN OF THE NATURE OF THE CARGO STOP ORDERS FOR ONWARDS SHIPMENT FROM TINNOSET WILL BE PROVIDED SEPARATELY STOP RJUKANFOS TO BE PREPARED FOR SHIPMENT AS A DECOY STOP GUARDS TO BE PLACED IN PROMINENT POSITIONS ON THIS VESSEL STOP SF HYDRO TO BE USED TO SHIP THE PRODUCT STOP LOADING PLANS TO BE ESTABLISHED FOR A DUMMY CARGO ON SF RJUAKANFOS STOP ADDITIONAL SECURITY MEASURES SHOULD NOT BE PUT IN PLACE ON THE LANDING STAGE FOR SF HYDRO STOP SECURITY ROUTINES MUST BE MAINTAINED IN ORDER TO REINFORCE THE DECOY ON RJUKANFOS STOP HEAVY WATER TO BE KEPT UNDER OBSERVATION AT ALL TIMES STOP EXTRA SECURITY TO BE PROVIDED ON ALL TRANSPORT UNTIL THE CARGO HAS REACHED DIE ALCHEMISTEN STOP LOCAL OFFICIALS AND EMPLOYEES ARE TO BE ASSUMED TO WORK FOR THE RESISTANCE UNLESS VETTED STOP INFORMATION ABOUT THE SHIPMENT SHOULD BE ENCRYPTED USING HIGH GRADE FIELD CIPHERS STOP TEMPORARY SECURITY MEASURES CAN ONLY BE LIFTED ONCE THE CARGO HAS REACHED THE NEXT STAGING POST STOP EXTRA RESOURCES CAN BE PROVIDED FOR ALL ASPECTS OF THIS MISSION ON REQUEST TO DIE ALCHEMISTEN STOP'" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pb = wcat(caesar_decipher(w, i + 1) for i, w in enumerate(mcb.split()))\n", + "pb" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1686" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open(plaintext_b_filename, 'w').write(pb)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['clampdown']" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "transpositions[kwordb]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "jupytext": { + "formats": "ipynb,md" + }, + "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.7.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/2020-early/2020-a-challenge9.md b/2020-early/2020-a-challenge9.md new file mode 100644 index 0000000..ee05d2e --- /dev/null +++ b/2020-early/2020-a-challenge9.md @@ -0,0 +1,162 @@ +--- +jupyter: + jupytext: + formats: ipynb,md + text_representation: + extension: .md + format_name: markdown + format_version: '1.2' + jupytext_version: 1.3.4 + kernelspec: + display_name: Python 3 + language: python + name: python3 +--- + +```python +import os,sys,inspect +currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0,parentdir) +``` + +```python +from cipher.caesar import * +from cipher.affine import * +from cipher.keyword_cipher import * +from cipher.column_transposition import * +from cipher.vigenere import * +from cipher.autokey import * + +from support.text_prettify import * +from support.utilities import * +from support.plot_frequency_histogram import * +%matplotlib inline +``` + +```python +challenge_number = 9 +plaintext_a_filename = f'{challenge_number}a.plaintext' +plaintext_b_filename = f'{challenge_number}b.plaintext' +ciphertext_a_filename = f'{challenge_number}a.ciphertext' +ciphertext_b_filename = f'{challenge_number}b.ciphertext' +``` + +```python +ca = open(ciphertext_a_filename).read() +cb = open(ciphertext_b_filename).read() + +sca = sanitise(ca) +pca = letters(ca) +pta = depunctuate(ca) + +scb = sanitise(cb) +pcb = letters(cb) +ptb = depunctuate(cb) +``` + +```python +fc = collections.Counter(sca) +plot_frequency_histogram(fc, sort_key=fc.get) +``` + +```python +kworda, score = vigenere_frequency_break(sca, fitness=Ptrigrams) +kworda +``` + +```python +pa = vigenere_decipher(sca, kworda) +pa +``` + +```python +fpa = lcat(tpack(segment(pa))) +print(fpa) +``` + +```python +open(plaintext_a_filename, 'w').write(fpa) +``` + +```python +morse_letters = {} +morse_codes = {} +with open('morse.txt') as f: + for line in f.readlines(): + l, c = line.split() + morse_letters[c] = l + morse_codes[l] = c +morse_letters +``` + +```python +mcb = wcat(cat(morse_letters[l] for l in w.split()) for w in cb.split(' / ')) +smcb = sanitise(mcb) +mcb +``` + +```python +fc = collections.Counter(sanitise(mcb)) +plot_frequency_histogram(fc, sort_key=fc.get) +``` + +```python +index_of_coincidence_scan(smcb, max_key_length=30) +``` + +```python +kwordb, score = vigenere_frequency_break(smcb, fitness=Ptrigrams, max_key_length=30) +kwordb +``` + +```python +kwordb, score = autokey_sa_break(smcb, fitness=Ptrigrams, max_keylength=10, max_iterations=5000) +kwordb +``` + +```python +autokey_decipher(smcb, kwordb) +``` + +```python +tgs = [smcb[i:i+3] for i in range(len(smcb)-2)] +collections.Counter(tgs).most_common(10) +``` + +```python +wcat(w for w in mcb.split() if len(w) == 3) +``` + +```python +wcat(w if len(w) >= 3 and w.lower() in keywords else w.lower() + for w in mcb.split()) +``` + +```python +[(i, w) for i, w in enumerate(mcb.split()) + if len(w) >= 3 + if w.lower() in keywords ] +``` + +```python +[(i, w) for i, w in enumerate(mcb.split()) + if i % 26 == 25 ] +``` + +```python +pb = wcat(caesar_decipher(w, i + 1) for i, w in enumerate(mcb.split())) +pb +``` + +```python +open(plaintext_b_filename, 'w').write(pb) +``` + +```python +transpositions[kwordb] +``` + +```python + +``` diff --git a/2020-early/9a.ciphertext b/2020-early/9a.ciphertext new file mode 100644 index 0000000..1745c0a --- /dev/null +++ b/2020-early/9a.ciphertext @@ -0,0 +1 @@ +IRZDQ PSEID VQHWW THVUY MDWGQ BYSRO UFZFR TPIBE XKCZW XRTXG POOSV KBTWX TSIDK AAXMV RYTRI RJTWQ XIVAQ UHBQE SPBMJ ZSGWP WBTWT HGEDB EQJXH UITKI FAHBN XSACW SGHUI JELGK MFVEM KZMUD GNREK PQLKO POUFD QEHFX AIZTQ LASEE JCEMQ MFNGL JBTWF GRPWV ADWFO VRPGM DSMWB RBCIO GGGVH FIIND XOZSV EBAXK CYPJE OELHQ XABJA QJBCH WMPLM ETURH XZBTL PCYSD FUALB JRWFZ OTLVO EKPNI SGGGN REJMH WGDNW TVVSW KKNKP EAEMY TRVJE OPSFO TIPLZ MYXBG WJEBT WIZNR UYIHW VCAJJ IUQVM VNXUY QEZTG FPPNM PLAST ISDIZ HEOAX PJPUH MVRVF DIUFB BTWUF KWKHT CSURA EANAC ISFFU VXHBH JVIXU ASZMT KMZJX GREST PRSVW YMUZM EAGPR VMZVU FIFRT BIIFA HBSSS KPQKA WCQFE BOAOW YMBEA MJXBB PPEOQ JTZYS XVLMU VSFWU FBTWK OVPXR GMFWD NXSFT EZTJR FFVVE LXDCI ELXEW VIEMU PIFSE ZGLFI IUDPO LWURB UGGGU ETSMQ FLWTR JWQOS GHYCJ EKDWT GRHTN IXDHK UEWVU MLVVR HUYQE TRWAG SVIEA GUGLF ZZAOG GHVWV QXDTB PIPEB TWKXH OBETU FXOAH QIWBG LSQEO LUNWK CSTMR VELHW AXFIK QHMHU ITYQB EXBGF VKBTW XBUEO TMPKX QHVJK GYSDS VXWVZ KMGZV OFCGF ZTHNW URVPS KRFEC FBMYX KBYMU AGUVS RHJEL AAGUZ SSVBT SGRRP BPQZY MVRWI ZXYWG HNPUV ZZSMW IITZV ODNRV RHKPQ DHQNP GVZDQ KCHXF JIDWU SVRHR KFAOS YCDFV EAWSE IERAI AMVGL FRQDJ TWQGJ MQXAT BPETL IXLBS FESVI YSCCE GPEAU VXFNX JFVNM MHUIQ CIZLW WEIDK WDTCO ERFEQ XKLSA MTJGY HTHUI UZKMF WANCC VINDX HBMOW TGWGQ RXIVL MLXOA HUZUQ GYGUM QDMZL BBBVE VZFGK SQYDV BTWKW FOPEK QEHFR SVIIS WGHFL BMMNW XBFYD TMEKY IYMOZ VFWKQ RTUZV SWGSZ CDFUY MGWPE UZWZK VCAGF IVUFZ HUINZ AEAHB NREKP QWGQY STVLF WESTV BDAGE FOEMT ZVSLA SCPBE AOGGT VVNJW GJHKA MOMME LBUNX JFVEO BHUXI ZAUFA OAHJK PUFDH UITNI XDHKG IBDEU DEPRE CCMFG XLRGV KMMKN QPITJ NGDLO OSURO QSGRU SQVNG DEMGI SDQZS MSGLF XMDET BAYDC MMJPS NTPEA BJHUE ENCMF KACCI XVKMF XBQXI ZAEGH BCLJC diff --git a/2020-early/9a.plaintext b/2020-early/9a.plaintext new file mode 100644 index 0000000..2badc44 --- /dev/null +++ b/2020-early/9a.plaintext @@ -0,0 +1,18 @@ +harry we received further encouraging reports from swallow about the effects of the usa afraid the +secondary targets of the attack were the station at rj uk an the industrial tracks and the track to +ve mork while the railway tracks themselves remain operational a considerable amount of rolling +stock was seriously damaged with two locomotives eight cargo wagons and seven passenger wagons +suffering damage our agents in the plant have confirmed that this has slowed the german plan to ship +the remaining stocks of potassium peroxide to die alchemist en research facilities in berlin in +preparation for the shipment civilians are no longer allowed access to the railway and patrols have +been stepped up security at all the railway stations has been significantly increased swallow have +matched this by increasing their own surveillance on the rj uk an line and proposed a number of +plans to intercept the shipment but the enhanced security make it very unlikely that a standard +sabotage would succeed in doing more than delaying the shipment alternatives including the local +ferry routes are being actively considered as with the air raid civilian casualties area major +consideration but the plant director bjarne nilssen is sympathetic and maybe able to influence the +dateandtime of shipment in order to reduce the risk once more our agents have been successful in +intercepting enemy communications concerning the mission and the enclosed telegram summarising the +plans confirms our own investigations with this in hand i think the swallow team will be able to +execute a successful sabotage and hopefully terminate the german nuclear weapons program lets hope +we can end this soon phil \ No newline at end of file diff --git a/2020-early/9b.ciphertext b/2020-early/9b.ciphertext new file mode 100644 index 0000000..4577f2b --- /dev/null +++ b/2020-early/9b.ciphertext @@ -0,0 +1 @@ +-..- -... --. --. ..-. --- - -.. .. ...- ..- .- - ..- -... --. --. ..-. -- / ...- --.- / ..-. .-. .-. ..- --. .-.. --.- -.. .-- .... / ... - .. ...- . -..- -- ... .-. .-- / -.- - .-- / -.-- -. --- ...- ... -.- - --.. / ...- -- / -... .--. -- / . -. ...- -..- .- - / --.. -... -.-- -. . -- -.. / . --.. / ..-. - --.- / ... -. --. ..- .-. . -.-- -. .- --.- / --. .... -.-. -.. / .-.. - .-- --. -... .--. .-. .-- .. .... .. --. - -..- ..- - -.-. ... -..- - -.-. .... .. / ..-. ..- .... .. . -.. -.. ..- -... / -.- ..-. / . ... .- ..-. .-.. ... .- ..-. / .-.. -- - -- -... .... --. / -- -.-- .-- --- .-.. -.-. -. ... / -. --- .--- -.- / ... .-- -.-- -.. / -.-- -..- --.- -..- ..-. .. .. .-.. -.- / .-. -- / --. --.. ..- -.. / .-. . ... .--. --- -. ... .. -... .. .-.. .. - -.-- / --. .--. ... / ..- --. . .-- - -.- ...- .- / .-. .. / -..- .-.. .. / .-- - --.- --.- -. ... .-.. / -.-- --.. ..- .. --.- / --.. .- ...- .-- / .-.. --.- -- / .--- ..- .-.. --.- -. ...- .-. -... -.-. -. .-- / -.. -.-- / -.-. .--. . .-.. - -.-- / .- .... --.- -.. -- -..- -..- / .--. -... --.. --.. -. .- --.- / -.-. - / .. .-- - / -.-. -.-- .. .. -.-- . -.. / .--- -.- ..-. --. / --. .... .-- .--- ... .-.. .- --. ..-. ... -.. / ...- .... --. -- -.- .... . / ..-. -.-. -.-- -- / .-. -.. --- -.-. / .--. -.. .- / -.-. -... .. .- -.. -... -.- .- -..- --- .--- -... --- ..-. -... / --.- .-. -- -. / ... --.- --.. -... .--- / .- -. -.. / ..- ... -... .--- --- / ..- --. . .-- - -.- ...- .- / .-.. ...- / -..- .-.. .. / .-- .--- -..- ..- - ... -..- -. --. -. --.- -. -.-- -.. / ..- .-.. / --. -... -. -.. .... .--- --- / .- -... .-- -..- / .-.. -..- -.. .-- -.-. -. .- .-. .-- -.-. -. ..- ..- .-. .--. -. .-- .-.. -. / -.. -.-- / -- .--. / ..-. - --.- / . .-. ..-. -.-. -... .- ..-. ...- --- ...- -.-- ...- --. .-.. / -.-. - / .. .-- - / --.- .-. -- ..- -..- .... / .--- -.- ..-. --. / .- ..-. .-.. .-- -.. -.. .- -.-- .-- ..-. ..- .-- / ...- .... --. ...- -..- -.- --. -... --. --.. / ..- ..-. ..-. / ...- -. -.- --.. -..- --- -. / -.- -... / --.- . -... / -.- --. --.- --.- --. -- .-.. / ... -. / -... . / -.. .--. .--. ... . .--- --- -... ..- ..-. . / -..- -.- -.-. / .-- -.- .... / .-- -- --. .-.. .. ...- .-.. .. -- -..- .-- .... -- .. .-. .-- -..- / -..- -.-- - ..- / ...- .-. --. - --.. / -.- .--. -.-- .-.. .--- .- ...- -.-- / .--- .-. .. --.. ...- -- / .-- .-. ..- -... -... -. .-- / ... -.-. / -.-. .--. -.. .- --.. -.-- -.. - -- .-- .--. / .-. .- -.. / -.-. . .-. -.-. -. . -. --. ...- -... .- / -.-. - / .. .-- - / .. -..- -.-- ..-. -.-. ..- -.. .--- / .--- -.- ..-. --. / --.. .-- / .- - .-.. / -.-. .... --.. .. .-.. --. -.-- -..- / .--. -. / .--. -.. .-- .--. / . -... / ..- --. .--- .--- / .- -.. / .-. . .- -.. -.-- / ..- .--. / ..- .--- -.- .-. / .-- -.- .... / -- -..- .. --.- / - ... / -.-- .- - .--- --. . / .- -.. .-.. ..- .- .--. .-.. .- --- / -. -- .--- --.. -.-. .. --.. --. / -... -.-. -..- -.-- / --- ..-. --- -... .. -.-- -..- --- / - -.-- --. --.. .-- --. .--. --- / ..- --.. / --. ..- .-. / --. ...- .-- -.. .- ... -... .... / .. -.. / .-. ..- / -- ...- -.- -.- ...- ..- / - --.- / -- .- -..- / ..-. .. .-- ..- ..-. / -. -..- -.-. .--. --- ..- -. --- ...- .- .- --.. --. / --- .--. -.- .-.. / --- -... -- .-.. --- --.- .--. / -- -.. / --.. -- -..- / .-. . ... .. ... - .- -. -.-. . / -... -.. ..- .--- .-- .--- ..- --.. / -.-. - --. / .-- .-. / ..-. .. / -.- - .-- -... ..-. .-- .. .--- .. / --.. ..- / .- --- .-.. / .. .--- . -- .--. --.. / -... -.-. -..- -.-- / -- -.- -.-. ..- -.-. / . --.. / -. --.- / . .-. .--- .-. ...- - ..- .-. --.- / --- .... / --. -.-- .--- --.. .--. -.-. / .--- . / ...- . .--- .-.. .. ...- / .-.. --.. .-- / . .... - .-- / -... ..- -- / .. .--- --- / -..- .- .- .--- / --.- -..- .--- -- -... --- -... .- / ..- --. .-. ..-. / .-. ... -. --- / .... .- -. -.. --- ...- . .-. / ..- .--. / -.. --. / .--. .-. --.- .-.. .-- .-. ..- .... --. / --. .--. ... .-- .. .--. -.-. / ..-. -.-- / -.- -... -.- -..- . / --.. .- .... -. .-.. / .--- --. / .. -.. .--. ..-. .--- .-.. --.- / -.-. -.. -.-- --.. / .-.. .-- .-- / -.. .- -..- -..- ..- --.. ... / ..-. --. -... .--. -..- / .... -.-. / --.- - / -.-- -.. .. ..-. ..- ... .--- ..- - / -.- -.-- ..-. .. ..-. .-.. -..- -.-- -.-. .--. / - --.- / .--. -..- .- -.- ..-. - ...- .- -- .-.. -- -.- -..- -... -.-- -..- --. .-- -... -..- --. .-.. -- / ...- -.-- --.. .. .-.. -.-- / --. .--- ...- -.-- -.. .. -... / --- .--. -.- .-.. / .. .-.. -..- .- ..-. -.- -.. / -. .--- -.-- .-. -.. -- .--. -.- --.- / ... -. / -... . / .--- --- - --.- ..-. -.. ..- ..-. . / ..-. -.-. -.- -. .- / -..- --.- .-- .-.. --- / -..- .-.. .. / -..- -- -. ..- .-. .--- ... -.-- / --. - .--- / --- ...- -... -.-- ... ..-. / .-.. -.-. --.. --.- ...- --- / -.-. --.- -. / -.-- --.. --- -... -.- -.. ... -.-- -..- / -.. . --.. .- / -..- --.- -- .... --.- / .--. -. .- .--. .-. -.-- -.-- .-. --.- / - -.-. ..-. / .--. .- .- / .--- .... . . ..-. .. / .-. . ..- / .... --. -.. .- ..- .-- / .-.. -- .... .. / -.-- .--. -.-- .-.. ... / ...- -- .... - / --.- .--- . .--. / ..-. -.- / .-. ..-. -.-. / ..- .... -... .... -- .... ... -..- / .. ... / ... ..-. .-. ...- .--- ... ..-. . / ...- --.- / ... ..- .-. -.-- .-.. --. .... / -.- -.-- . ...- .... / ..- ..-. -.-- .-- - --.- -..- / .-.. ..- -..- / -.-- ...- ... ... .--. ..- -. / .- -... .-- -.- ... / .- -..- -.. -.-. -. / -.-. -.. -.-- --.. / -.-- - .--. .-- -.. .--. -.-- / ..-. .- / --- .-. / .-- -... --. .... ..-. .. --.- .... ... .-. / .. -.. / . .... .-- --.- -.. -.-- .. ..- / -.- -.-- ...- / .-.. .--- ... ..-. -.- .... --. .--- .-.. / .... -.-- / -. -... -.-- / -. -.-. -.. -.- .... --.. .. --- / --- .--. -.- .-.. / -.. -... . -... ..-. .--- -... / -.. -.-. .--- -... -. -- .--- --. -..- -.-. --. / ... -. / -- --- -. .. - --- .-. / - ..- -... --. --. / -.-. ...- / .... -.-- .... ..- -... / .-- -..- . -..- -- ... .-. / ..-. ... .. / ..- - / .-.. -.-. .-.. -.-- ..-. / -... --.. .. --.- ...- / -... -.-. -..- -.-- / --- -..- -.. -... .. --. -.- .. -.-. / . --.. / ..-. - --.- / -.-. -.-- -. .- --. / --- -... .-. / --. .--. -..- .- / ...- --.- ... -.-- -... -.-- .--- -.-- ..- .. / -.- ..-. / - .-- / --.. -. - -.- .-- -..- .-- / ...- ... / .-. --.. -.-. -- .... ...- -..- -.-. --- -. --- -- --.. -.. .- --.. .. -.-- -.. --.. .. -. --- / .-.. .- -. --- -.- .--- .--- .- .... / -..- --.- / -.-- .--- .--- / ... .... .-.. -.. .-. / ... - --- .--. / . .--. .--. ... - / ...- --.- / .-- -.- .... / .-- -..- ... ...- . -.- .. / ..-. ... .. / --.. -..- --. - -.-- ...- ..- -..- --.. / -- .... .--- .--. ... .--. .- .--. .-.. --.. / -... .-- / -.- -. / ...- -.-- -- ..- --- -. / .-.. . / -- -..- -..- / --. ...- --.. .-. ..-. / --. .... -.-. -.. / -.. .--- .. .... -..- ... - / .--- -..- ..- / -.-. ..-. -..- --.. .--- -.- --.. - .--- / .-.. .-- ... . / - --. .-- / ..-. .. .-- ..- ..-. / -. --.. -..- .--. -- -.. --- - / -.- .-.. .- -. .-- .--. . -.- .--- --- / .-.. -.- .. ...- / -- -.. -.. --. .- -.-. .--. --.- / -. . / - .... . / - - / -.-. .--. ..-. / .--. .... .--. . .... ..- ...- / ... .--- / .. -. .--- / --. .-. .. -. -.- ... --- -.-- --.. -.- - / .--- .... ..- / .--- -- / .-.. -..- -.-- .-. -. -- / ... -..- -.. -.-- / . ... .--. / -... -..- -- --.. . / ..-. --. -... -.-. / .... .-- -... -... -.-. --. ... .... / .. -.. / .-. ..- / --. .. ...- --. .-. .. ...- ..- / .-.. --. / -.- -..- ...- -..- -... --- -..- / -. -... -.-- / -. -.-. -.. -.- .... --.. .. --- / -..- --.- .--. / -.- .-.. / --. .-.. -... --. .- -.-- .-. --. -- .-.. / .-. --. -. - -.- -.-. / -... . / .... .--- .-- ..-. --- / --.- .... / .-- -.- .... / .-. . -..- -.-- ...- .. / - -.- / --.. -. -.- / .--- .... -.-- -. ...- / .- -... .-- -..- / -..- .- -- -. .- -... / .--. -.-- -... / --.. -.-- .... .-.. -.-. --- -.. / . - ..- -... -.-- --.- --.. ..-. / ... . -... --.. / .... .-- -... -... -.-. --. ... .... / .-.. -..- .- .- / .-. ..- / --. .. ..-. -- --.. ..- ...- ..- / -.- .-- .... ... .--- ... .-.. .-- -.. --.- / .-.. -- .... .. / .-.. -.. --- . ..- .... --.. .. -- / --- .--- / -..- .- / -- --- -... -- -..- --- -... .- / -.. -- .--. / .-. --. .... --- .-.. -.. -- ... / .- ... / -... / ..-. --. . --.- .- / ...- .-- .-. ... / -.- -.-- . ...- .... .-- / -.-- - / .... -.- / .-- ... .... .--- .-.. -.- / --.- ...- / -.-- .- -..- ...- .-. .-- -. .-- -.-. / --.. -.-- -.-. ... -.. ... -.-- -..- -.-. / --.. -.-- / ..-. - ..- . / .. .-. ..-. ..-. .-. -.-- / --. .... -.-. -.. / .... ..- / -..- --- - .... . / -.- ..-. / - .-- / -. .-.. -..- .-- / -. .. / -. -.-. -.. -.- / .--. -.. .- / -- --- .-.. .- .-. --.. --.- / --.- .-. -- -. / -.- -. --.. -.-. .... -- ..-. / .--. .-.. .- -. ... / ..- .--. / -.. --. / .... ...- .-- -.. . --- .-.. ...- -.- .... --. / .--- ... ...- / ..-. / .--- .- ... ... . / .--- .... -.-- -. ...- / .-- ...- / -... --- / -... - . -.- ..- -.- -..- .--. -.-- -.-. / -.. . --.. .- / -- .--. .--. ..- ..-. ..- .- --.. -- -..- / ..-. .-. .--. .... . ...- --. .-.. / .- ... --- --. .. ..-. ... --. / .... .-- -.. .--- .- ... / -.. . .--- / ... ...- / .... -- .-.. / -... --. / .--- ..-. ..- .-- -.-- / .--- .. / .--. -.. .- / .. -..- -.- .- ..-. -.- -.. / --.- .-. -.-- . -.-. / . -. --.- / ... ..-. / .. --.. . ... .--. / ..- ...- --.- .-. / ...- .... ..-. -..- ..- .-.. .-- -... / ...- ... -.-- -..- -- .-. .. .-- / .-. --.. -..- -.-- / .... -.- / - .... .--. ..- .- .... .--. ..- .-.. -.- / --.- ...- / -..- .- -- -. .- / -.. -.-- / -.-. .--. - -.-- --.- --.. -.-. -. .--. / ..-. - --.- / --.- .-. .--. -... .-.. / -.-. -... / --. -.-- .--- --.. .--. -.-. ..- -.. .... / .. .--- . ..-. / -.-- ...- .-. -- .--. / --- ... .-.. .-- .--- / -- .... / ...- -.-- / ..-. --.. -.- --- / --.- .--- --.. .- -. / .-.. -.-- .--. -... --- ... -..- --.- ..-. .-.. -.- / -.-- .-. / --.. -.- -.- / - .. -- . ... / - ..- .--. --.- / --. --.. ...- - -.-. / ...- .... ..-. -..- ..- .-.. .-- -... / -..- ... / --. .--- / ...- -..- ..- -... --- .--- -.- .--- / ...- ..- / .. - - / -.-. .- .--- .-- -... -.-- -..- .- -.-. / . -..- -.. ... ...- / . ... .--. / --- -- -.. ... .- / ..- -. ..-. / ..-. ... --- --.- ...- ... .-. / ... -..- - / --.- -... ... -..- ..- -.-. -.-- .. .--- ..- -.. / .--- -.- ..-. --. / -.. --. ..- ... -.. / .... -.-- -.-- -... ...- -... - . .-.. / ..- .... -..- / --.. .... -.- --. .--- - --.. --.. -. / .-- -. .- / --.- .-.. / --.. -.-. / --.. .-. .-. - .-.. -.. -.-. / - --- / -..- .--. ... .-.. / .... --.- - / .-- -.- .... / ...- .. .-- -- .-- -..- . .-. --. .. / --.. ... --.- .--- -..- -..- / -... -.- --.. --.. -.- .--- / --.. .- ...- .-- / --.- ...- -. .-- --.. ..- .. -... --.- .-- ...- / .--- -.- -..- -.. -.-. / -.. .-. --- / -.. ... - .- -..- .--. -.-- . / . - .- --. -..- .--. / --- .-. / ... -... --.- ..-. -- -.. .... ... .-. / .--- .... -..- -.-. ...- / -..- -.-- .-- -..- / -..- .. .-. ..- ...- / -..- .- .-- -.. ...- / ...- -... .. .- -..- -.- .-.. / -- -. .. .--- / --- --.. .... -.- .--- -- ...- -- - / --- .- -.-- --.- -. . .--. ..- / .--- -... -..- .--. .-. --- -... .--. / .- -.-- .-.. / -. -- -.- -..- / -... . / -- .--- --. ..- ..-. . / --.- .--. . --. / .-- -.- .... / --. . ...- -.- ... / -- ..-. -..- / -..- -.- --. .. -. -.- .--- / .- --- .-.. / ...- -- ..-. -... / -... -.-. .--- .--. .-. .-- .--. / --.. -.-- -.-. -.. / -.. . --.. .- / --.- .--- ..-. -.. -- / . .-. ..-. -... .... . .--. .-. ..-. / --.- --- -... / --.- - / ..-. .... . .-.. -.-- - ..- - / .-- ..-. .. / ... -.. -.. / - .-.. .. -..- ...- -- .-.. / .. --.. / --- -.-. -.. -. / .. . --- --- . -.- .--- / .-.. -.- / .--. -.-. --- ... -.-. --.- .-. / ... -. / -.. .. . / -... -- -.. .. ..-. -. .--- - ..- ..-. --- / ..- ...- --.- .-. diff --git a/2020-early/9b.plaintext b/2020-early/9b.plaintext new file mode 100644 index 0000000..10f16bb --- /dev/null +++ b/2020-early/9b.plaintext @@ -0,0 +1 @@ +WAFFENSCHUTZSTAFFEL TO COORDINATE OPERATIONS FOR SHIPMENT OF THE VEMORK PRODUCT TO THE FATHERLAND STOP WEHRMACHTSTREIFENDIENST PERSONNEL TO MAINTAIN STATION SECURITY STOP WACH BATAILLON TO HAVE RESPONSIBILITY FOR SECURITY OF THE ROLLING STOCK STOP DIE ALCHEMISTEN TO RETAIN OVERALL COMMAND OF THE MISSION STOP OPERATIONAL CONTROL LIES WITH THE FELDGENDARMERIE STOP TRACK AND TRAIN SECURITY IS THE RESPONSIBILITY OF ZUGWACH STOP COUNTERINTELLIGENCE TO BE THE RESPONSIBILITY OF THE ABWEHR STOP INTELLIGENCE CONCERNING ALL ASPECTS OF THE MISSION TO BE COORDINATED VIA THE SICHERHEITSDIENST STOP PLANT DIRECTOR BJARNE NILSSEN IS RESPONSIBLE FOR PREPARATION OF THE SHIPMENT STOP HE HAS INFORMED US THAT HE WILL BE READY TO SHIP THE ITEM ON SUNDAY TWENTIETH FEBRUARY STOP EVERYONE INVOLVED IN THE SHIPMENT TO BE VETTED BY THE LOCAL SCHUTZSTAFFEL STOP REPORTS OF ANY RESISTANCE ACTIVITY ARE TO BE FORWARDED TO THE ABWEHR STOP CASKS TO BE REWEIGHED AT RJUKAN TO ENSURE THE LOAD HAS NOT BEEN TAMPERED WITH STOP HANDOVER TO BE MONITORED CLOSELY AT EVERY STAGE BY ZUGWACH STOP ALL ROLLING STOCK TO BE INSPECTED THOROUGHLY BY WEHRMACHTSTREIFENDIENST BEFORE LOADING STOP LOADING PLATFORMS TO BE INSPECTED DAILY UNTIL THE SHIPMENT AND HOURLY DURING THE OPERATION STOP LEAVE CANCELLED FOR ALL TROOPS AND POLICE STOP EVERY ARMY UNIT IN THE VICINITY IS REQUIRED TO PROVIDE GUARD PATROLS FOR ROLLING STOCK ROUTE STOP NIELSEN TO BE INSTRUCTED TO ORGANISE THE TRANSPORT OF THE SHIPMENT STOP GEHEIME FELDPOLIZEI TO MONITOR STAFF AT EVERY STATION AND ON EVERY TRAIN STOP ENTRYWAYS TO THE PLANT AND RAIL FACILITIES TO BE GUARDED BY WEHRMACHTSTREIFENDIENST PERSONNEL AT ALL TIMES STOP DOORS TO THE STORAGE AND TRANSPORT FACILITIES TO BE LOCKED AT ALL TIMES STOP OUTSIDE THE LOGISTICS TEAM AND LOCAL SECURITY OPERATIONS ONLY OFFICERS OF THE SS AND MEMBERS OF DIE ALCHEMISTEN CAN BE COPIED INTO THE PLANS STOP TINNOSET TO BE PREPARED TO RECEIVE THE SHIPMENT BUT NO INDICATION SHOULD BE GIVEN OF THE NATURE OF THE CARGO STOP ORDERS FOR ONWARDS SHIPMENT FROM TINNOSET WILL BE PROVIDED SEPARATELY STOP RJUKANFOS TO BE PREPARED FOR SHIPMENT AS A DECOY STOP GUARDS TO BE PLACED IN PROMINENT POSITIONS ON THIS VESSEL STOP SF HYDRO TO BE USED TO SHIP THE PRODUCT STOP LOADING PLANS TO BE ESTABLISHED FOR A DUMMY CARGO ON SF RJUAKANFOS STOP ADDITIONAL SECURITY MEASURES SHOULD NOT BE PUT IN PLACE ON THE LANDING STAGE FOR SF HYDRO STOP SECURITY ROUTINES MUST BE MAINTAINED IN ORDER TO REINFORCE THE DECOY ON RJUKANFOS STOP HEAVY WATER TO BE KEPT UNDER OBSERVATION AT ALL TIMES STOP EXTRA SECURITY TO BE PROVIDED ON ALL TRANSPORT UNTIL THE CARGO HAS REACHED DIE ALCHEMISTEN STOP LOCAL OFFICIALS AND EMPLOYEES ARE TO BE ASSUMED TO WORK FOR THE RESISTANCE UNLESS VETTED STOP INFORMATION ABOUT THE SHIPMENT SHOULD BE ENCRYPTED USING HIGH GRADE FIELD CIPHERS STOP TEMPORARY SECURITY MEASURES CAN ONLY BE LIFTED ONCE THE CARGO HAS REACHED THE NEXT STAGING POST STOP EXTRA RESOURCES CAN BE PROVIDED FOR ALL ASPECTS OF THIS MISSION ON REQUEST TO DIE ALCHEMISTEN STOP \ No newline at end of file diff --git a/2020-early/morse.txt b/2020-early/morse.txt new file mode 100644 index 0000000..578b456 --- /dev/null +++ b/2020-early/morse.txt @@ -0,0 +1,49 @@ +A .- +B -... +C -.-. +D -.. +E . +F ..-. +G --. +H .... +I .. +J .--- +K -.- +L .-.. +M -- +N -. +O --- +P .--. +Q --.- +R .-. +S ... +T - +U ..- +V ...- +W .-- +X -..- +Y -.-- +Z --.. +0 ----- +1 .---- +2 ..--- +3 ...-- +4 ....- +5 ..... +6 -.... +7 --... +8 ---.. +9 ----. +. .-.-.- +, --..-- +? ..--.. +- -....- +/ -..-. +: ---... +' .----. +- -....- +) -.--.- +; -.-.- +( -.--. += -...- +@ .--.-.