Done challenge 7
authorNeil Smith <neil.git@njae.me.uk>
Wed, 16 Dec 2020 18:19:44 +0000 (18:19 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Wed, 16 Dec 2020 18:19:44 +0000 (18:19 +0000)
2020/2020-challenge7.ipynb [new file with mode: 0644]
2020/2020-challenge7.md [new file with mode: 0644]
2020/ciphertext.7a.txt [new file with mode: 0644]
2020/ciphertext.7b.txt [new file with mode: 0644]
2020/plaintext.7a.txt [new file with mode: 0644]
2020/plaintext.7b.txt [new file with mode: 0644]

diff --git a/2020/2020-challenge7.ipynb b/2020/2020-challenge7.ipynb
new file mode 100644 (file)
index 0000000..f6bc948
--- /dev/null
@@ -0,0 +1,1037 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 220,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "from szyfrow.keyword_cipher import *\n",
+    "from szyfrow.column_transposition import *\n",
+    "from szyfrow.vigenere import *\n",
+    "from szyfrow.support.text_prettify import *\n",
+    "from szyfrow.polybius import *\n",
+    "from szyfrow.caesar import *\n",
+    "import collections\n",
+    "from itertools import *"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 150,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "challenge_number = 7\n",
+    "plaintext_a_filename = f'plaintext.{challenge_number}a.txt'\n",
+    "plaintext_b_filename = f'plaintext.{challenge_number}b.txt'\n",
+    "ciphertext_a_filename = f'ciphertext.{challenge_number}a.txt'\n",
+    "ciphertext_b_filename = f'ciphertext.{challenge_number}b.txt'"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 151,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "ca = open(ciphertext_a_filename).read()\n",
+    "sca = sanitise(ca)\n",
+    "rsca = cat(reversed(sca))\n",
+    "cb = open(ciphertext_b_filename).read()\n",
+    "scb = cat(c for c in cb if c in (string.ascii_letters + '#+'))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "triangle \n",
+      "\n",
+      "theattacheddocumentwasinterceptedbyharrysteamwhohavemanagedtoplantabugonthecommunicationlinesoutoftirpitzuferourcryptanalystshaveexaminedtheciphertextandthecasefilesandbelievethatitmayberelatedtothewheatstoneclockcipherdeputyheadofthedivisionhaswrittenabossguidetotheseciphermachinesandwehaveaddedthattothecasefilesharrysteamalsorecoveredascrapofburntpaperfromtheabwehrhqwastewhichcarriesthefollowingmessagewhichwethinkmightbepartoftheplaintexttentialstopthetripwireoptionisalsodeprecatedsinceitismorelikelythattheexplthenavyreportedthatadutchfishingvesselwasimpoundedbythenaziauthoritiesinbremerhaventhecrewweredetainedandnegotiationsareunderwaybetweenthedutchandgermanauthoritiestotrytogetthefishermenandtheirvesselbackbutinthemeantimernpatrolswillwatchoutfortheboatincaseitisinvolvedintheoperationtheairministryhavebeenbriefedonourfindingssofarandhaveemphasisedtheimportanceofprotectingtherdfsystemwhichiamtoldtheycallchainhomevkissympatheticbutthethreeofusarestillworriedaboutthenewagentsembeddedinlondonandwearenotsurehowmuchofathreattheyposeitiscrucialthatwebreaktheattachedciphertextasfastaspossiblesowecanputeffectivecountermeasuresinplaceitistemptingtoarrestalltwentythreespyclistsandaskthemdirectlybutwithoutrevealingtheextentofoursurveillanceandcodebreakingabilityitwillnotbepossibletoprovethattheyhavebrokenthelawsowewouldnotbeabletodetainordeportthemitwouldusuallybebettertowatchandwaitbuttheairministryfeelsthattherisktoourairdefenceistoogreatsoweneedtoactfastifweknewexactlywhenandwheretheyintendedtoattackchainhomethenwemightbeabletoincreasesecuritytopreventitbutagainweriskrevealingourcounterintelligencecapabilitiesharrysuggestedthatwecouldobscureourtracksbyfakingavisitbydignitariestothetargetsitesasacoverstoryforincreasedsecuritybutwecantmaintaintheincreaseforlongwithoutraisingsuspicionsoitiscrucialtodeterminetheirplanswhatevertheabwehrareintendingtheywontwanttheiragentstofallintoourhandsespeciallyafterademolitionsincethatwouldgiveustheexcuseweneedtoarrestthemitwouldbegoodtoknowwhattheyhaveinmindfortheirexfiltrationthingsareveryfinelybalancedifweacttoosoonwegiveawayourcrucialadvantageintheinterceptwarifweacttoolateourenemiescouldseriouslydamageourairdefencecapabilityitisclearthatthingsarecomingtoaheadanditiscrucialthatwecracktheclockcipherassoonaspossiblethefateofthecountryliesinyourhandspearl\n"
+     ]
+    }
+   ],
+   "source": [
+    "key_a, score_a = vigenere_frequency_break(sca, fitness=Ptrigrams)\n",
+    "print(key_a, '\\n')\n",
+    "pa = vigenere_decipher(sca, key_a)\n",
+    "print(pa)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "the attached document was intercepted by harry steam who have managed to plant a bug on the\n",
+      "communication lines out of tirpitz ufer our crypt analysts have examined the ciphertext and the case\n",
+      "files and believe that it maybe related to the wheatstone clock cipher deputy head of the division\n",
+      "has written a boss guide to these cipher machines and we have added that to the case files harry\n",
+      "steam also recovered a scrap of burnt paper from the abwehr hq waste which carries the following\n",
+      "message which we think might be part of the plaintext tential stop the tripwire option is also\n",
+      "deprecated since it is more likely that the expl the navy reported that a dutch fishing vessel was\n",
+      "impounded by the nazi authorities in bremerhaven the crew were detained and negotiations are\n",
+      "underway between the dutch and german authorities to try to get the fishermen and their vessel back\n",
+      "but in the meantime rn patrols will watch out for the boat in case it is involved in the operation\n",
+      "the air ministry have been briefed on our findings so far and have emphasised the importance of\n",
+      "protecting the rdf system which i am told they call chain home vk is sympathetic but the three of us\n",
+      "are still worried about the new agents embedded in london and we are not sure how much of a threat\n",
+      "they pose it is crucial that we break the attached ciphertext as fast as possible so we can put\n",
+      "effective countermeasures in place it is tempting to arrest all twenty three spy c lists and ask\n",
+      "them directly but without revealing the extent of our surveillance and code breaking ability it will\n",
+      "not be possible to prove that they have broken the law so we would not be able to detain or deport\n",
+      "them it would usually be better to watch and wait but the air ministry feels that the risk to our\n",
+      "air defence is too great so we need to act fast if we knew exactly when and where they intended to\n",
+      "attack chain home then we might be able to increase security to prevent it but again we risk\n",
+      "revealing our counterintelligence capabilities harry suggested that we could obscure our tracks by\n",
+      "faking a visit by dignitaries to the target sites as a coverstory for increased security but we cant\n",
+      "maintain the increase for long without raising suspicion so it is crucial to determine their plans\n",
+      "whatever the abwehr are intending they wont want their agents to fall into our hands especially\n",
+      "after a demolition since that would give us the excuse we need to arrest them it would be good to\n",
+      "know what they have in mind for their exfiltration things are very finely balanced if we act too\n",
+      "soon we giveaway our crucial advantage in the intercept war if we act too late our enemies could\n",
+      "seriously damage our air defence capability it is clear that things are coming to ahead and it is\n",
+      "crucial that we crack the clock cipher as soon as possible the fate of the country lies in your\n",
+      "hands pearl\n"
+     ]
+    }
+   ],
+   "source": [
+    "pa = prettify(vigenere_decipher(sca, key_a))\n",
+    "print(pa)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 236,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2843"
+      ]
+     },
+     "execution_count": 236,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "open(plaintext_a_filename, 'w').write(pa)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 152,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'tentialstopthetripwireoptionisalsodeprecatedsinceitismorelikelythattheexpl'"
+      ]
+     },
+     "execution_count": 152,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "crib = sanitise(\"tential stop the tripwire option is also deprecated since it is more likely that the expl\")\n",
+    "crib"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 153,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'#+ABCDEFGHIJKLMNOPQRSTUVWXYZ'"
+      ]
+     },
+     "execution_count": 153,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cat(sorted(set(scb)))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 192,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "p_alpha = string.ascii_lowercase\n",
+    "c_alpha = string.ascii_uppercase + '#+'"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 193,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(c_alpha))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 197,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def decipher_letter(cipher_letter, stream):\n",
+    "    stream = dropwhile(lambda p: p[1] != cipher_letter, stream)\n",
+    "    stream, temp_stream = tee(stream, 2)\n",
+    "    (plain_letter, c) = list(islice(temp_stream, 1))[0]\n",
+    "    return (plain_letter, islice(stream, 1, None))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 198,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def encipher_letter(plain_letter, stream):\n",
+    "    stream = dropwhile(lambda p: p[0] != plain_letter, stream)\n",
+    "    stream, temp_stream = tee(stream, 2)\n",
+    "    (p, cipher_letter) = list(islice(temp_stream, 1))[0]\n",
+    "    return (cipher_letter, islice(stream, 1, None))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 199,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('b', 'd', 'z', 'b', 'd', 'f', 'h')"
+      ]
+     },
+     "execution_count": 199,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(c_alpha))\n",
+    "p1, s1 = decipher_letter('B', cipherstream)\n",
+    "p2, s2 = decipher_letter('D', s1)\n",
+    "p3, s3 = decipher_letter('Z', s2)\n",
+    "p4, s4 = decipher_letter('+', s3)\n",
+    "p5, s5 = decipher_letter('B', s4)\n",
+    "p6, s6 = decipher_letter('D', s5)\n",
+    "p7, s7 = decipher_letter('D', s6)\n",
+    "\n",
+    "p1, p2, p3, p4, p5, p6, p7"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 200,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('b', 'd')"
+      ]
+     },
+     "execution_count": 200,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(c_alpha))\n",
+    "p1, s1 = decipher_letter('B', cipherstream)\n",
+    "p2, s2 = decipher_letter('B', s1)\n",
+    "\n",
+    "p1, p2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 201,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def decipher_message(ciphertext, stream):\n",
+    "    plaintext = ''\n",
+    "    for l in ciphertext:\n",
+    "        p, stream = decipher_letter(l, stream)\n",
+    "        plaintext += p\n",
+    "    return plaintext, stream    "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 202,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def encipher_message(plaintext, stream):\n",
+    "    ciphertext = ''\n",
+    "    for l in plaintext:\n",
+    "        c, stream = encipher_letter(l, stream)\n",
+    "        ciphertext += c\n",
+    "    return ciphertext, stream    "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 203,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'vxnozddfahharfgoxiyg'"
+      ]
+     },
+     "execution_count": 203,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(c_alpha))\n",
+    "pb, s = decipher_message(scb[:20], cipherstream)\n",
+    "pb"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 204,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'TCLREWFMNGHLZUHDU+GS+MWX+OURKUALSM+ALN#WSJUREUZMOSBQ#SUXIPKMELYRDWNLZUSJ+V'"
+      ]
+     },
+     "execution_count": 204,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(c_alpha))\n",
+    "c_gen, s = encipher_message(crib, cipherstream)\n",
+    "c_gen"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 205,
+   "metadata": {
+    "Collapsed": "false",
+    "scrolled": true
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[(19, 'T'),\n",
+       " (2, 'C'),\n",
+       " (11, 'L'),\n",
+       " (17, 'R'),\n",
+       " (4, 'E'),\n",
+       " (22, 'W'),\n",
+       " (5, 'F'),\n",
+       " (12, 'M'),\n",
+       " (13, 'N'),\n",
+       " (6, 'G'),\n",
+       " (7, 'H'),\n",
+       " (11, 'L'),\n",
+       " (25, 'Z'),\n",
+       " (20, 'U'),\n",
+       " (7, 'H'),\n",
+       " (3, 'D'),\n",
+       " (20, 'U'),\n",
+       " (27, '+'),\n",
+       " (6, 'G'),\n",
+       " (18, 'S'),\n",
+       " (27, '+'),\n",
+       " (12, 'M'),\n",
+       " (22, 'W'),\n",
+       " (23, 'X'),\n",
+       " (27, '+'),\n",
+       " (14, 'O'),\n",
+       " (20, 'U'),\n",
+       " (17, 'R'),\n",
+       " (10, 'K'),\n",
+       " (20, 'U'),\n",
+       " (0, 'A'),\n",
+       " (11, 'L'),\n",
+       " (18, 'S'),\n",
+       " (12, 'M'),\n",
+       " (27, '+'),\n",
+       " (0, 'A'),\n",
+       " (11, 'L'),\n",
+       " (13, 'N'),\n",
+       " (26, '#'),\n",
+       " (22, 'W'),\n",
+       " (18, 'S'),\n",
+       " (9, 'J'),\n",
+       " (20, 'U'),\n",
+       " (17, 'R'),\n",
+       " (4, 'E'),\n",
+       " (20, 'U'),\n",
+       " (25, 'Z'),\n",
+       " (12, 'M'),\n",
+       " (14, 'O'),\n",
+       " (18, 'S'),\n",
+       " (1, 'B'),\n",
+       " (16, 'Q'),\n",
+       " (26, '#'),\n",
+       " (18, 'S'),\n",
+       " (20, 'U'),\n",
+       " (23, 'X'),\n",
+       " (8, 'I'),\n",
+       " (15, 'P'),\n",
+       " (10, 'K'),\n",
+       " (12, 'M'),\n",
+       " (4, 'E'),\n",
+       " (11, 'L'),\n",
+       " (24, 'Y'),\n",
+       " (17, 'R'),\n",
+       " (3, 'D'),\n",
+       " (22, 'W'),\n",
+       " (13, 'N'),\n",
+       " (11, 'L'),\n",
+       " (25, 'Z'),\n",
+       " (20, 'U'),\n",
+       " (18, 'S'),\n",
+       " (9, 'J'),\n",
+       " (27, '+'),\n",
+       " (21, 'V')]"
+      ]
+     },
+     "execution_count": 205,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "co = [(c_alpha.find(l), l) for i, l in enumerate(c_gen)]\n",
+    "co"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 206,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'VXLKVZXZSZXODRQYFQEM'"
+      ]
+     },
+     "execution_count": 206,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "scb[:20]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 207,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def offsets(ciphertext):\n",
+    "    mappings = {}\n",
+    "    letters_seen = 0\n",
+    "    offsets = []\n",
+    "    for l in ciphertext:\n",
+    "        if l not in mappings:\n",
+    "            mappings[l] = letters_seen\n",
+    "            letters_seen += 1\n",
+    "        offsets.append(mappings[l])\n",
+    "    return offsets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 208,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "74"
+      ]
+     },
+     "execution_count": 208,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "crib_offsets = offsets(c_gen)\n",
+    "len(crib_offsets)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 209,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def plausible_samples(generated_text):\n",
+    "    plausible_samples = {}\n",
+    "    for i in range(len(scb)):\n",
+    "        sample = scb[i:(i + len(crib))]\n",
+    "        if len(sample) == len(crib):\n",
+    "            ofs = offsets(sample)\n",
+    "            if ofs == crib_offsets:\n",
+    "                plausible_samples[i] = sample\n",
+    "    return plausible_samples"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 210,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'TCLREWFMNGHLZUHDU+GS+MWX+OURKUALSM+ALN#WSJUREUZMOSBQ#SUXIPKMELYRDWNLZUSJ+V'"
+      ]
+     },
+     "execution_count": 210,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "c_gen"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 211,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "def plausible_mapping(crib_output):\n",
+    "    mapping = {}\n",
+    "    for n, l in crib_output:\n",
+    "        if n in mapping:\n",
+    "            if mapping[n] != l:\n",
+    "                return {}\n",
+    "        else:\n",
+    "            mapping[n] = l\n",
+    "    return mapping"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 212,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{19: 'T', 2: 'C', 11: 'L'}"
+      ]
+     },
+     "execution_count": 212,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "plausible_mapping(co[:3])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 213,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 1: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 2: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 3: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 4: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 5: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 6: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 7: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 8: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 9: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 10: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 11: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 12: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 13: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 14: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 15: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 16: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 17: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 18: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 19: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 20: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 21: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 22: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 23: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 24: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'},\n",
+       " 25: {1026: 'KW+ASVCNDJM+BPM#PLJHLNVZLUPAXPR+HNLR+DIVHGPASPBNUHFOIHPZTYXNS+QA#VD+BPHGLE'}}"
+      ]
+     },
+     "execution_count": 213,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "solutions = {}\n",
+    "for i in range(26):\n",
+    "    cipherstream = zip(islice(cycle(p_alpha), i, None),\n",
+    "                       cycle(c_alpha))\n",
+    "    c_gen, s = encipher_message(crib, cipherstream)\n",
+    "    solutions[i] = plausible_samples(c_gen)\n",
+    "solutions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 225,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "12"
+      ]
+     },
+     "execution_count": 225,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "1026 % 26"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 214,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'TCLREWFMNGHLZUHDU+GS+MWX+OURKUALSM+ALN#WSJUREUZMOSBQ#SUXIPKMELYRDWNLZUSJ+V'"
+      ]
+     },
+     "execution_count": 214,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(c_alpha))\n",
+    "c_gen0, s = encipher_message(crib, cipherstream)\n",
+    "c_gen0"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 215,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'ABCDEFGHIJKLMNOPQRSTUVWXYZ#+'"
+      ]
+     },
+     "execution_count": 215,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "c_alpha"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 216,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{19: 'K',\n",
+       " 2: 'W',\n",
+       " 11: '+',\n",
+       " 17: 'A',\n",
+       " 4: 'S',\n",
+       " 22: 'V',\n",
+       " 5: 'C',\n",
+       " 12: 'N',\n",
+       " 13: 'D',\n",
+       " 6: 'J',\n",
+       " 7: 'M',\n",
+       " 25: 'B',\n",
+       " 20: 'P',\n",
+       " 3: '#',\n",
+       " 27: 'L',\n",
+       " 18: 'H',\n",
+       " 23: 'Z',\n",
+       " 14: 'U',\n",
+       " 10: 'X',\n",
+       " 0: 'R',\n",
+       " 26: 'I',\n",
+       " 9: 'G',\n",
+       " 1: 'F',\n",
+       " 16: 'O',\n",
+       " 8: 'T',\n",
+       " 15: 'Y',\n",
+       " 24: 'Q',\n",
+       " 21: 'E'}"
+      ]
+     },
+     "execution_count": 216,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "soln = solutions[0][1026]\n",
+    "alpha_pos = [c_alpha.find(c) for c in c_gen0]\n",
+    "c_alpha_mapped = {}\n",
+    "\n",
+    "for p, c in zip(alpha_pos, soln):\n",
+    "    c_alpha_mapped[p] = c\n",
+    "c_alpha_mapped"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 217,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'RFW#SCJMTGX+NDUYOAHKPEVZQBIL'"
+      ]
+     },
+     "execution_count": 217,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "discovered_c_alpha = cat(c_alpha_mapped[i] if i in c_alpha_mapped else ' ' for i in range(28))\n",
+    "discovered_c_alpha"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 218,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "28"
+      ]
+     },
+     "execution_count": 218,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "len(c_alpha_mapped)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 226,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'NDUYOAHKPEVZQBILRFW#SCJMTGX+'"
+      ]
+     },
+     "execution_count": 226,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "rotated_c_alpha = discovered_c_alpha[12:] + discovered_c_alpha[:12]\n",
+    "rotated_c_alpha"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 219,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'wmdxabqdmfuazomftqpdmxfaiqdtmenqqzmbbdahqpmzpagdmsqzfemdqmddmzsuzsfabdahupqkagiuftftqfzfkagdqcgqefqpuzkagdxmefyqeemsqefabftueiuxxnqetubbqpazmpgfotruetuzshqeeqxituotiuxxxmzpmfftqymdetqearraxpxqustmffiamyazrdupmkpqoqynqdfqzftefabftqkiuxxeuszmxftqudmdduhmxnkrxmetuzsftqudzmhusmfuazxustfeuzyadeqoapqfaebqxxagfftqiadprxmfmzpkagiuxxdqbxkfkdqefaburkagnqxuqhqftmfkagmdqnquzsimfotqpftqzmnmzpazftqdqzpqlhagemzpfdkmsmuzmfuzfqdhmxearfiapmkeftdqqpmkeruhqpmkemzpeqhqzpmkeefabpazafmffqybffaymwqoazfmofiuftftqnamfadufeodqiuzmzkaftqdimkefabftqqjbxaeuhqueefmnxqngfetagxpnqfdqmfqpiuftomdqefabftqrgeqemdqftqyaefdqoqzfbdapgofaragddqeqmdotmzpfqotzaxaskpuhueuazmzpomddkfdubxqfdussqdeefabftqktmhqmfuyqdoudogufituotymknqeqfradmzkbqduaprdayftdqqyuzgfqefaeqhqzfqqztagdeefabftqkomzmxeanqfdussqdqpnkmfdubiudqmeeqynxkadftqrgeqyqotmzueyomznqdqbxmoqpiuftmtmzpsdqzmpqyqotmzueyefabeuzoqftqeqotmdsqetmhqnqqzetmbqpradpqyaxufuazgeqiqpazafdqoayyqzpgeuzsftqeqpqhuoqeuzoaynmfeuzoqkagtmhqzaoqdfmuzfkftmfftqotmdsqiuxxxmzpuzmzaduqzfmfuazftmfiuxxymjuyuequfepqefdgofuhqbafqzfumxefabftqfdubiudqabfuazuemxeapqbdqomfqpeuzoqufueyadqxuwqxkftmfftqqjbxaeuhqeiuxxnqpueoahqdqpurftqkmdqmffmotqpfaegotmfdussqdmzpyadqahqdufiagxpnqpurruogxffaoaadpuzmfqftqotmdsqegeuzsegotmpqhuoqefabftqotmdsqeftqyeqxhqemdqeymxxngfftqsqayqfdkarftqbmowmsqiuxxraogeftqnxmefeaufueuybqdmfuhqftmfkaguzefmxxftqeqotmdsqeuzmooadpmzoqiuftftqymzgrmofgdqdeuzefdgofuazeefabuzadpqdfaymjuyueqftqpmymsqfaftqfaiqdeftqqzsuzqqdedqoayyqzpftmfkageqfotmdsqeazftdqqarftqxqsearqmotfaiqdiuftotmdsqefiamzpftdqqeqffaqjbxapquzeqcgqzoqmrfqdotmdsqazqefabeqfmzmppufuazmxpqxmkarftudfkeqoazperadotmdsqfiamzpazqyuzgfqfiqzfkruhqeqoazperadotmdsqftdqqefabmeftqrudefxqsngowxqeufiuxxefdqeeftqrdmyqeaftmfftqetaowimhqarftqeqoazpotmdsqiuxxpuefadfftqegbbadfuzsyqynqdeefabiuftftqftudpqjbxaeuazftqrdmyqetagxpngowxqdqegxfuzsuzftqfafmxpqefdgofuazarftqfaiqdengfftueeqcgqzoqiuxxymwqeufqoxqmdmzoqmzpdqoazefdgofuaztmdpqdfamooaybxuetefabftqpqxmkiuftotmdsqftdqqmxeauzodqmeqeftqxuwqxutaapftmfeaxpuqdeiuxxtmhqmdduhqpazeufquzfuyqfanqomgstfuzftqftudpnxmefuzodqmeuzsoazrgeuazmzpxaeearyadmxqefaburufuebaeeunxqfaoxuynftqfaiqduzmphmzoqarftqpqyaxufuazfasqfyadqpqfmuxqpuymsqearftqmqdumxmzpmybxuruqdoudogufdkftqzftueetagxpnqmffqybfqptaiqhqdurftqdquemzksgmdpbdqeqzoqftqzzadueweetagxpnqfmwqzuzftuedqsmdpefabiqygefxqmhquffakagfapqfqdyuzqftqyaefqrrqofuhqfmdsqferadftqabqdmfuazngfftqpqyaxufuazygeftmbbqzeuygxfmzqagexkmfmxxeufqeradfiadqmeazeefabrudefuzadpqdfabdqhqzfagdqzqykrdaypuedgbfuzsftqabqdmfuazazoqftqkdqmxueqitmfuetmbbqzuzsefabeqoazpiqygefxqmhqzapagnfftmfftueimemzmofarimdefabftqdquemduewftmfftqndufuetsahqdzyqzfymkfdkfadqmotmzmooayyapmfuaziuftftqrgtdqdpuhupuzsftqiadxpnqfiqqzftqudpkuzsqybudqmzpagdevgefmeufuenadzefabftqazxkimkfaqzegdqftmfiqomzfdgxkegbbxmzfftqyuefapdmiftqyuzfamimdftqkomzzafiuzmzpftuebdavqofiuxxnqftqbdahaomfuazftmfqzegdqeftmfftueiuxxtmbbqzefabftqbxmzzuzspuhueuaztmepqfqdyuzqpftmfvmzgmdkrudefiuxxnqftqabfuymxzustfradftqmffmowmeufoauzoupqeiuftmzqiyaazefabftqkegssqefftmfkagebxufuzfafiafqmyefamffmowftqqpygzpefomuefadmzpomzqipazeufqeabqzuzsmoaddupadmxazsftqftmyqeradagdradftoayuzsmuddmupeefabftqegbbadffqmyeetagxpeqfgbxaawagfbaefemfftqfmdsqfeuzmphmzoqarftqmffmoweaftmfkagomzyazufadsgmdpyahqyqzfemzpymwqmruzmxmeeqeeyqzfarftqeqogdufkefabraxxaiuzsftqabqdmfuazftqemnafmsqfqmyeetagxpdqzpqlhagefasqftqdiuftftqegbbadffqmyemfftqtayqarftqxaomxadfesdgbbqotuqruzeagftymxpazefabmgnamfiuxxefmzpnkfabuowkagmxxgbmfftdqqradfkeqhqzvmzgmdkeqoazpiuftmrmxxnmowdqzpqlhagearazqftudfqqzazftqftudfqqzftitqzftqeqmdotetagxptmhqpuqppaizefabkagiuxxzqqpfasmuzmooqeefamnamfombmnxqaromddkuzskagmxxagffayqqfufefabftqdqmdqhqdkymzkruetuzshqeeqxeuzftuezqustnagdtaapmzpiqdqoayyqzpefqmxuzsazqmrfqdftqabqdmfuazefabufyustfrqqxxqeeeqogdqftmfanfmuzuzsazquzmphmzoqtaiqhqdiqygefpaqhqdkftuzsiqomzfabdqhqzfegebuouazuzmphmzoqarftqabqdmfuazefaburftueyueeuazegooqqpeftqzufiuxxnqazxkmymffqdarpmkenqradqftqimdnqsuzemzpkagdftdqqoaydmpqeuzxazpaziuxxbxmkmodgoumxdaxquzoaadpuzmfuzsagduzfqxxusqzoqqrradfenqtuzpqzqykxuzqeefabiqtmhqnqqzimfotuzsmzpxuefqzuzsomdqrgxxkradeuszeftmfftqabqdmfuazoagxptmhqnqqzoaybdayueqpmzpmemdqegxfarftaeqqzcguduqeiqtmhqpueoahqdqpmzqifabeqodqfmsqzokwzaizazxknkftqmodazkynaeeefabiqtmhqnqqzgzmnxqfauzruxfdmfqftuesdagbngfufuewzaizftmfftqxqmpqdueeayqazqiuftftquzufumxtmzpftmfftqkmdqfmwuzsftqxqmpazeuszmxeuzfqxxusqzoqefabftqtqmparftqoagzfqduzfqxxusqzoqndmzotgeqeftqoapqzmyqbqmdxmzpiqiuxxnqymwuzsqhqdkqrradffapueoahqdtqdupqzfufkefabituxqftqpqoxmdmfuazarimdmzpftqpqefdgofuazarftqdprekefqymdqftqoqzfdmxsamxearftueabqdmfuazftqxazpazfdumzsxqiuxxnqwqkfaqzegduzsmrxaiartustcgmxufkuzfqxxusqzoqfauzradyagdnmffxqbxmzeefabiuftagfftqudoayygzuomfuazeiqiuxxnqgzmnxqfayazufadndufuetbxmzebxmouzssqdymzxuhqemfgzzqoqeemdkduewefaburftqdquemzkotmzoqftmfyqynqdearkagdsdagboagxpnqombfgdqpmzpuzfqddasmfqpftqzkagetagxpmnmzpazftqemnafmsqabqdmfuazmzpdqfgdzfafudbuflgrqdefabbdafqofuzsftqupqzfufkarftqfdumzsxquearrmdsdqmfqdxazsfqdyuybadfmzoqfageefabiqomzruzpaftqdimkefabdahawqftqimdngfiqiagxpruzpufyadqpurruogxffaqzegdqftmfiqomziuzufiuftagfmzqfiadwarmsqzfeuzftqombufmxefabftqyueeuaziuxxnqdqsmdpqpmemegooqeeazxkuriqomzsgmdmzfqqftqudemrqfkefabfauzodqmeqftqeqogdufkarftqxazpazfdumzsxqufueodgoumxftmfftqoxaowoubtqdpqhuoqmzpftqmeeaoumfqpoapqnaawedqmotagdxazpazmsqzfeefabftqpqhuoqomzzafnqmxxaiqpfarmxxuzfaqzqyktmzpemzpftueygefnqftqfabbduadufkefaburkagmdqombfgdqpftqzftqoapqnaawoazfmuzuzsftqwqkefaftqoubtqdygefnqpqefdakqpefabufuebduzfqpazebqoumxbmbqdftmfetagxpqmeuxkpueeaxhqngfufomzmxeanquzsqefqpurzqoqeemdkefabitqzgeuzsftqymotuzqfmwqomdqfaqdmeqftqoubtqdmxbtmnqfmrfqdgeqmzpfapqxqfqftqwqkrdayftqoapqnaawfaqzegdqftmfzaazqgeqeftqemyqwqkfiuoqefabftueiuxxmxeadqpgoqftqduewarftqwqkqpoubtqdrmxxuzsuzfaqzqyktmzpeefaburombfgdqmbbqmdeuyyuzqzfftqzgeqazqarftqetmbqpotmdsqefapqefdakftqpqhuoqbdqrqdmnxkngdkuzsuffasqftqdiuftftqotmdsqfauzodqmeqftqpqefdgofuhqbaiqdmzpymwquftmdpqdfadqoazefdgofefabqhqdkazquzftqyahqyqzfiuxxnqbdmkuzsradkagdegooqeemzpkagdoagdmsqmzpoayyufyqzffaftqrmftqdxmzpiuxxnqbdmueqpradqhqdefabkagmdqmzuzebudmfuazfagemxxefabiuetuzskagxgowuzftqruzmxbtmeqarftqabqdmfuazefabkagdegzoxqiuxtqxy'"
+      ]
+     },
+     "execution_count": 219,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(discovered_c_alpha))\n",
+    "c_gen, s = decipher_message(scb, cipherstream)\n",
+    "c_gen"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 221,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(12, -7510.337448308099)"
+      ]
+     },
+     "execution_count": 221,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "caesar_break(c_gen)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 222,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'karloperationcathedraltowerhasbeenapprovedandouragentsarearrangingtoprovideyouwiththetntyourequestedinyourlastmessagestopthiswillbeshippedonadutchfishingvesselwhichwilllandatthemarshesoffoldleighattwoamonfridaydecembertenthstoptheywillsignaltheirarrivalbyflashingtheirnavigationlightsinmorsecodetospelloutthewordflatandyouwillreplytyrestopifyoubelievethatyouarebeingwatchedthenabandontherendezvousandtryagainatintervalsoftwodaysthreedaysfivedaysandsevendaysstopdonotattempttomakecontactwiththeboatoritscrewinanyotherwaystoptheexplosiveisstablebutshouldbetreatedwithcarestopthefusesarethemostrecentproductofourresearchandtechnologydivisionandcarrytripletriggersstoptheyhaveatimercircuitwhichmaybesetforanyperiodfromthreeminutestoseventeenhoursstoptheycanalsobetriggeredbyatripwireassemblyorthefusemechanismcanbereplacedwithahandgrenademechanismstopsincethesechargeshavebeenshapedfordemolitionusewedonotrecommendusingthesedevicesincombatsinceyouhavenocertaintythatthechargewilllandinanorientationthatwillmaximiseitsdestructivepotentialstopthetripwireoptionisalsodeprecatedsinceitismorelikelythattheexplosiveswillbediscoverediftheyareattachedtosuchatriggerandmoreoveritwouldbedifficulttocoordinatethechargesusingsuchadevicestopthechargesthemselvesaresmallbutthegeometryofthepackagewillfocustheblastsoitisimperativethatyouinstallthesechargesinaccordancewiththemanufacturersinstructionsstopinordertomaximisethedamagetothetowerstheengineersrecommendthatyousetchargesonthreeofthelegsofeachtowerwithchargestwoandthreesettoexplodeinsequenceafterchargeonestopsetanadditionaldelayofthirtysecondsforchargetwoandoneminutetwentyfivesecondsforchargethreestopasthefirstlegbucklesitwillstresstheframesothattheshockwaveofthesecondchargewilldistortthesupportingmembersstopwiththethirdexplosiontheframeshouldbuckleresultinginthetotaldestructionofthetowersbutthissequencewillmakesiteclearanceandreconstructionhardertoaccomplishstopthedelaywithchargethreealsoincreasesthelikelihoodthatsoldierswillhavearrivedonsiteintimetobecaughtinthethirdblastincreasingconfusionandlossofmoralestopifitispossibletoclimbthetowerinadvanceofthedemolitiontogetmoredetailedimagesoftheaerialandamplifiercircuitrythenthisshouldbeattemptedhoweverifthereisanyguardpresencethennorisksshouldbetakeninthisregardstopwemustleaveittoyoutodeterminethemosteffectivetargetsfortheoperationbutthedemolitionmusthappensimultaneouslyatallsitesfortworeasonsstopfirstinordertopreventourenemyfromdisruptingtheoperationoncetheyrealisewhatishappeningstopsecondwemustleavenodoubtthatthiswasanactofwarstopthereisariskthatthebritishgovernmentmaytrytoreachanaccommodationwiththefuhrerdividingtheworldbetweentheirdyingempireandoursjustasitisbornstoptheonlywaytoensurethatwecantrulysupplantthemistodrawthemintoawartheycannotwinandthisprojectwillbetheprovocationthatensuresthatthiswillhappenstoptheplanningdivisionhasdeterminedthatjanuaryfirstwillbetheoptimalnightfortheattackasitcoincideswithanewmoonstoptheysuggestthatyousplitintotwoteamstoattacktheedmundstcaistorandcanewdonsitesopeningacorridoralongthethamesforourforthcomingairraidsstopthesupportteamsshouldsetuplookoutpostsatthetargetsinadvanceoftheattacksothatyoucanmonitorguardmovementsandmakeafinalassessmentofthesecuritystopfollowingtheoperationthesabotageteamsshouldrendezvoustogetherwiththesupportteamsatthehomeofthelocalortsgruppechiefinsouthmaldonstopauboatwillstandbytopickyouallupatthreefortysevenjanuarysecondwithafallbackrendezvousofonethirteenonthethirteenthwhenthesearchshouldhavedieddownstopyouwillneedtogainaccesstoaboatcapableofcarryingyouallouttomeetitstopthereareverymanyfishingvesselsinthisneighbourhoodandwerecommendstealingoneaftertheoperationstopitmightfeellesssecurethatobtainingoneinadvancehoweverwemustdoeverythingwecantopreventsuspicioninadvanceoftheoperationstopifthismissionsucceedsthenitwillbeonlyamatterofdaysbeforethewarbeginsandyourthreecomradesinlondonwillplayacrucialroleincoordinatingourintelligenceeffortsbehindenemylinesstopwehavebeenwatchingandlisteningcarefullyforsignsthattheoperationcouldhavebeencompromisedandasaresultofthoseenquirieswehavediscoveredanewtopsecretagencyknownonlybytheacronymbossstopwehavebeenunabletoinfiltratethisgroupbutitisknownthattheleaderissomeonewiththeinitialhandthattheyaretakingtheleadonsignalsintelligencestoptheheadofthecounterintelligencebranchusesthecodenamepearlandwewillbemakingeveryefforttodiscoverheridentitystopwhilethedeclarationofwarandthedestructionoftherdfsystemarethecentralgoalsofthisoperationthelondontrianglewillbekeytoensuringaflowofhighqualityintelligencetoinformourbattleplansstopwithouttheircommunicationswewillbeunabletomonitorbritishplansplacinggermanlivesatunnecessaryriskstopifthereisanychancethatmembersofyourgroupcouldbecapturedandinterrogatedthenyoushouldabandonthesabotageoperationandreturntotirpitzuferstopprotectingtheidentityofthetriangleisoffargreaterlongtermimportancetousstopwecanfindotherwaystoprovokethewarbutwewouldfinditmoredifficulttoensurethatwecanwinitwithoutanetworkofagentsinthecapitalstopthemissionwillberegardedasasuccessonlyifwecanguaranteetheirsafetystoptoincreasethesecurityofthelondontriangleitiscrucialthattheclockcipherdeviceandtheassociatedcodebooksreachourlondonagentsstopthedevicecannotbeallowedtofallintoenemyhandsandthismustbethetopprioritystopifyouarecapturedthenthecodebookcontainingthekeystotheciphermustbedestroyedstopitisprintedonspecialpaperthatshouldeasilydissolvebutitcanalsobeingestedifnecessarystopwhenusingthemachinetakecaretoerasethecipheralphabetafteruseandtodeletethekeyfromthecodebooktoensurethatnooneusesthesamekeytwicestopthiswillalsoreducetheriskofthekeyedcipherfallingintoenemyhandsstopifcaptureappearsimminentthenuseoneoftheshapedchargestodestroythedevicepreferablyburyingittogetherwiththechargetoincreasethedestructivepowerandmakeithardertoreconstructstopeveryoneinthemovementwillbeprayingforyoursuccessandyourcourageandcommitmenttothefatherlandwillbepraisedforeverstopyouareaninspirationtousallstopwishingyouluckinthefinalphaseoftheoperationstopyoursunclewilhelm'"
+      ]
+     },
+     "execution_count": 222,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "caesar_decipher(c_gen, 12)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 229,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'karloperationcathedraltowerhasbeenapprovedandouragentsarearrangingtoprovideyouwiththetntyourequestedinyourlastmessagestopthiswillbeshippedonadutchfishingvesselwhichwilllandatthemarshesoffoldleighattwoamonfridaydecembertenthstoptheywillsignaltheirarrivalbyflashingtheirnavigationlightsinmorsecodetospelloutthewordflatandyouwillreplytyrestopifyoubelievethatyouarebeingwatchedthenabandontherendezvousandtryagainatintervalsoftwodaysthreedaysfivedaysandsevendaysstopdonotattempttomakecontactwiththeboatoritscrewinanyotherwaystoptheexplosiveisstablebutshouldbetreatedwithcarestopthefusesarethemostrecentproductofourresearchandtechnologydivisionandcarrytripletriggersstoptheyhaveatimercircuitwhichmaybesetforanyperiodfromthreeminutestoseventeenhoursstoptheycanalsobetriggeredbyatripwireassemblyorthefusemechanismcanbereplacedwithahandgrenademechanismstopsincethesechargeshavebeenshapedfordemolitionusewedonotrecommendusingthesedevicesincombatsinceyouhavenocertaintythatthechargewilllandinanorientationthatwillmaximiseitsdestructivepotentialstopthetripwireoptionisalsodeprecatedsinceitismorelikelythattheexplosiveswillbediscoverediftheyareattachedtosuchatriggerandmoreoveritwouldbedifficulttocoordinatethechargesusingsuchadevicestopthechargesthemselvesaresmallbutthegeometryofthepackagewillfocustheblastsoitisimperativethatyouinstallthesechargesinaccordancewiththemanufacturersinstructionsstopinordertomaximisethedamagetothetowerstheengineersrecommendthatyousetchargesonthreeofthelegsofeachtowerwithchargestwoandthreesettoexplodeinsequenceafterchargeonestopsetanadditionaldelayofthirtysecondsforchargetwoandoneminutetwentyfivesecondsforchargethreestopasthefirstlegbucklesitwillstresstheframesothattheshockwaveofthesecondchargewilldistortthesupportingmembersstopwiththethirdexplosiontheframeshouldbuckleresultinginthetotaldestructionofthetowersbutthissequencewillmakesiteclearanceandreconstructionhardertoaccomplishstopthedelaywithchargethreealsoincreasesthelikelihoodthatsoldierswillhavearrivedonsiteintimetobecaughtinthethirdblastincreasingconfusionandlossofmoralestopifitispossibletoclimbthetowerinadvanceofthedemolitiontogetmoredetailedimagesoftheaerialandamplifiercircuitrythenthisshouldbeattemptedhoweverifthereisanyguardpresencethennorisksshouldbetakeninthisregardstopwemustleaveittoyoutodeterminethemosteffectivetargetsfortheoperationbutthedemolitionmusthappensimultaneouslyatallsitesfortworeasonsstopfirstinordertopreventourenemyfromdisruptingtheoperationoncetheyrealisewhatishappeningstopsecondwemustleavenodoubtthatthiswasanactofwarstopthereisariskthatthebritishgovernmentmaytrytoreachanaccommodationwiththefuhrerdividingtheworldbetweentheirdyingempireandoursjustasitisbornstoptheonlywaytoensurethatwecantrulysupplantthemistodrawthemintoawartheycannotwinandthisprojectwillbetheprovocationthatensuresthatthiswillhappenstoptheplanningdivisionhasdeterminedthatjanuaryfirstwillbetheoptimalnightfortheattackasitcoincideswithanewmoonstoptheysuggestthatyousplitintotwoteamstoattacktheedmundstcaistorandcanewdonsitesopeningacorridoralongthethamesforourforthcomingairraidsstopthesupportteamsshouldsetuplookoutpostsatthetargetsinadvanceoftheattacksothatyoucanmonitorguardmovementsandmakeafinalassessmentofthesecuritystopfollowingtheoperationthesabotageteamsshouldrendezvoustogetherwiththesupportteamsatthehomeofthelocalortsgruppechiefinsouthmaldonstopauboatwillstandbytopickyouallupatthreefortysevenjanuarysecondwithafallbackrendezvousofonethirteenonthethirteenthwhenthesearchshouldhavedieddownstopyouwillneedtogainaccesstoaboatcapableofcarryingyouallouttomeetitstopthereareverymanyfishingvesselsinthisneighbourhoodandwerecommendstealingoneaftertheoperationstopitmightfeellesssecurethatobtainingoneinadvancehoweverwemustdoeverythingwecantopreventsuspicioninadvanceoftheoperationstopifthismissionsucceedsthenitwillbeonlyamatterofdaysbeforethewarbeginsandyourthreecomradesinlondonwillplayacrucialroleincoordinatingourintelligenceeffortsbehindenemylinesstopwehavebeenwatchingandlisteningcarefullyforsignsthattheoperationcouldhavebeencompromisedandasaresultofthoseenquirieswehavediscoveredanewtopsecretagencyknownonlybytheacronymbossstopwehavebeenunabletoinfiltratethisgroupbutitisknownthattheleaderissomeonewiththeinitialhandthattheyaretakingtheleadonsignalsintelligencestoptheheadofthecounterintelligencebranchusesthecodenamepearlandwewillbemakingeveryefforttodiscoverheridentitystopwhilethedeclarationofwarandthedestructionoftherdfsystemarethecentralgoalsofthisoperationthelondontrianglewillbekeytoensuringaflowofhighqualityintelligencetoinformourbattleplansstopwithouttheircommunicationswewillbeunabletomonitorbritishplansplacinggermanlivesatunnecessaryriskstopifthereisanychancethatmembersofyourgroupcouldbecapturedandinterrogatedthenyoushouldabandonthesabotageoperationandreturntotirpitzuferstopprotectingtheidentityofthetriangleisoffargreaterlongtermimportancetousstopwecanfindotherwaystoprovokethewarbutwewouldfinditmoredifficulttoensurethatwecanwinitwithoutanetworkofagentsinthecapitalstopthemissionwillberegardedasasuccessonlyifwecanguaranteetheirsafetystoptoincreasethesecurityofthelondontriangleitiscrucialthattheclockcipherdeviceandtheassociatedcodebooksreachourlondonagentsstopthedevicecannotbeallowedtofallintoenemyhandsandthismustbethetopprioritystopifyouarecapturedthenthecodebookcontainingthekeystotheciphermustbedestroyedstopitisprintedonspecialpaperthatshouldeasilydissolvebutitcanalsobeingestedifnecessarystopwhenusingthemachinetakecaretoerasethecipheralphabetafteruseandtodeletethekeyfromthecodebooktoensurethatnooneusesthesamekeytwicestopthiswillalsoreducetheriskofthekeyedcipherfallingintoenemyhandsstopifcaptureappearsimminentthenuseoneoftheshapedchargestodestroythedevicepreferablyburyingittogetherwiththechargetoincreasethedestructivepowerandmakeithardertoreconstructstopeveryoneinthemovementwillbeprayingforyoursuccessandyourcourageandcommitmenttothefatherlandwillbepraisedforeverstopyouareaninspirationtousallstopwishingyouluckinthefinalphaseoftheoperationstopyoursunclewilhelm'"
+      ]
+     },
+     "execution_count": 229,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cipherstream = zip(cycle(p_alpha), cycle(rotated_c_alpha))\n",
+    "p_gen, s = decipher_message(scb, cipherstream)\n",
+    "p_gen"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 233,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [],
+   "source": [
+    "pb = prettify(p_gen)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 235,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "7298"
+      ]
+     },
+     "execution_count": 235,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "open(plaintext_b_filename, 'w').write(pb)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "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/2020-challenge7.md b/2020/2020-challenge7.md
new file mode 100644 (file)
index 0000000..68c2660
--- /dev/null
@@ -0,0 +1,285 @@
+---
+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 Collapsed="false"
+from szyfrow.keyword_cipher import *
+from szyfrow.column_transposition import *
+from szyfrow.vigenere import *
+from szyfrow.support.text_prettify import *
+from szyfrow.polybius import *
+from szyfrow.caesar import *
+import collections
+from itertools import *
+```
+
+```python Collapsed="false"
+challenge_number = 7
+plaintext_a_filename = f'plaintext.{challenge_number}a.txt'
+plaintext_b_filename = f'plaintext.{challenge_number}b.txt'
+ciphertext_a_filename = f'ciphertext.{challenge_number}a.txt'
+ciphertext_b_filename = f'ciphertext.{challenge_number}b.txt'
+```
+
+```python Collapsed="false"
+ca = open(ciphertext_a_filename).read()
+sca = sanitise(ca)
+rsca = cat(reversed(sca))
+cb = open(ciphertext_b_filename).read()
+scb = cat(c for c in cb if c in (string.ascii_letters + '#+'))
+```
+
+```python Collapsed="false"
+key_a, score_a = vigenere_frequency_break(sca, fitness=Ptrigrams)
+print(key_a, '\n')
+pa = vigenere_decipher(sca, key_a)
+print(pa)
+```
+
+```python Collapsed="false"
+pa = prettify(vigenere_decipher(sca, key_a))
+print(pa)
+```
+
+```python Collapsed="false"
+open(plaintext_a_filename, 'w').write(pa)
+```
+
+```python Collapsed="false"
+crib = sanitise("tential stop the tripwire option is also deprecated since it is more likely that the expl")
+crib
+```
+
+```python Collapsed="false"
+cat(sorted(set(scb)))
+```
+
+```python Collapsed="false"
+p_alpha = string.ascii_lowercase
+c_alpha = string.ascii_uppercase + '#+'
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(c_alpha))
+```
+
+```python Collapsed="false"
+def decipher_letter(cipher_letter, stream):
+    stream = dropwhile(lambda p: p[1] != cipher_letter, stream)
+    stream, temp_stream = tee(stream, 2)
+    (plain_letter, c) = list(islice(temp_stream, 1))[0]
+    return (plain_letter, islice(stream, 1, None))
+```
+
+```python Collapsed="false"
+def encipher_letter(plain_letter, stream):
+    stream = dropwhile(lambda p: p[0] != plain_letter, stream)
+    stream, temp_stream = tee(stream, 2)
+    (p, cipher_letter) = list(islice(temp_stream, 1))[0]
+    return (cipher_letter, islice(stream, 1, None))
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(c_alpha))
+p1, s1 = decipher_letter('B', cipherstream)
+p2, s2 = decipher_letter('D', s1)
+p3, s3 = decipher_letter('Z', s2)
+p4, s4 = decipher_letter('+', s3)
+p5, s5 = decipher_letter('B', s4)
+p6, s6 = decipher_letter('D', s5)
+p7, s7 = decipher_letter('D', s6)
+
+p1, p2, p3, p4, p5, p6, p7
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(c_alpha))
+p1, s1 = decipher_letter('B', cipherstream)
+p2, s2 = decipher_letter('B', s1)
+
+p1, p2
+```
+
+```python Collapsed="false"
+def decipher_message(ciphertext, stream):
+    plaintext = ''
+    for l in ciphertext:
+        p, stream = decipher_letter(l, stream)
+        plaintext += p
+    return plaintext, stream    
+```
+
+```python Collapsed="false"
+def encipher_message(plaintext, stream):
+    ciphertext = ''
+    for l in plaintext:
+        c, stream = encipher_letter(l, stream)
+        ciphertext += c
+    return ciphertext, stream    
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(c_alpha))
+pb, s = decipher_message(scb[:20], cipherstream)
+pb
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(c_alpha))
+c_gen, s = encipher_message(crib, cipherstream)
+c_gen
+```
+
+```python Collapsed="false"
+co = [(c_alpha.find(l), l) for i, l in enumerate(c_gen)]
+co
+```
+
+```python Collapsed="false"
+scb[:20]
+```
+
+```python Collapsed="false"
+def offsets(ciphertext):
+    mappings = {}
+    letters_seen = 0
+    offsets = []
+    for l in ciphertext:
+        if l not in mappings:
+            mappings[l] = letters_seen
+            letters_seen += 1
+        offsets.append(mappings[l])
+    return offsets
+```
+
+```python Collapsed="false"
+crib_offsets = offsets(c_gen)
+len(crib_offsets)
+```
+
+```python Collapsed="false"
+def plausible_samples(generated_text):
+    plausible_samples = {}
+    for i in range(len(scb)):
+        sample = scb[i:(i + len(crib))]
+        if len(sample) == len(crib):
+            ofs = offsets(sample)
+            if ofs == crib_offsets:
+                plausible_samples[i] = sample
+    return plausible_samples
+```
+
+```python Collapsed="false"
+c_gen
+```
+
+```python Collapsed="false"
+def plausible_mapping(crib_output):
+    mapping = {}
+    for n, l in crib_output:
+        if n in mapping:
+            if mapping[n] != l:
+                return {}
+        else:
+            mapping[n] = l
+    return mapping
+```
+
+```python Collapsed="false"
+
+```
+
+```python Collapsed="false"
+plausible_mapping(co[:3])
+```
+
+```python Collapsed="false"
+solutions = {}
+for i in range(26):
+    cipherstream = zip(islice(cycle(p_alpha), i, None),
+                       cycle(c_alpha))
+    c_gen, s = encipher_message(crib, cipherstream)
+    solutions[i] = plausible_samples(c_gen)
+solutions
+```
+
+```python Collapsed="false"
+1026 % 26
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(c_alpha))
+c_gen0, s = encipher_message(crib, cipherstream)
+c_gen0
+```
+
+```python Collapsed="false"
+c_alpha
+```
+
+```python Collapsed="false"
+soln = solutions[0][1026]
+alpha_pos = [c_alpha.find(c) for c in c_gen0]
+c_alpha_mapped = {}
+
+for p, c in zip(alpha_pos, soln):
+    c_alpha_mapped[p] = c
+c_alpha_mapped
+```
+
+```python Collapsed="false"
+discovered_c_alpha = cat(c_alpha_mapped[i] if i in c_alpha_mapped else ' ' for i in range(28))
+discovered_c_alpha
+```
+
+```python Collapsed="false"
+len(c_alpha_mapped)
+```
+
+```python Collapsed="false"
+rotated_c_alpha = discovered_c_alpha[12:] + discovered_c_alpha[:12]
+rotated_c_alpha
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(discovered_c_alpha))
+c_gen, s = decipher_message(scb, cipherstream)
+c_gen
+```
+
+```python Collapsed="false"
+caesar_break(c_gen)
+```
+
+```python Collapsed="false"
+caesar_decipher(c_gen, 12)
+```
+
+```python Collapsed="false"
+cipherstream = zip(cycle(p_alpha), cycle(rotated_c_alpha))
+p_gen, s = decipher_message(scb, cipherstream)
+p_gen
+```
+
+```python Collapsed="false"
+pb = prettify(p_gen)
+```
+
+```python Collapsed="false"
+open(plaintext_b_filename, 'w').write(pb)
+```
+
+```python Collapsed="false"
+
+```
diff --git a/2020/ciphertext.7a.txt b/2020/ciphertext.7a.txt
new file mode 100644 (file)
index 0000000..e529202
--- /dev/null
@@ -0,0 +1 @@
+MYMAG ZLGAV LDBIF QXEBW NYTRM VZCRV EIWSG HNXCC LKMAZ CSSAR DEZGY EZVLT BVWEG KIBHM ZRMYM CBSXY GZKAG OZREZ VEFUF XHWBI EVTXS LNEEU FVVIG PGGYE EPATF NLZXV FAZOY IWKPE POALX IBEKZ LRWKP EPGDI YZTEF GYHUV TIRBP XARBI GSLCU VZEYG EIWKW TUKHL XRBSG UYIVC WCXIT TAVZD RVFXR YMAQU QXAVL IIODM HEPAF CCMMK MNNHZ WLXCI QKESM YMSRI TTAVZ MNISM GVAAA JHIAR DENJO IWKPA GZZXA VKAFK QMEVA HNXCC LKMAZ GWWHI MCBBP VXUIS PXLTH WJUET ETTGM RSXZQ MYMAO CPLKY YWNYE IPYQC UILVK ZMSGN PJHCT OJOYK FVASN MPAAZ KHJKE LBESM VMSXU VXAEZ ZJMYM PYGTR MVFTG KYXBR TSGUA XAVBR VVHMK VWPGO ZRBJI LFUOI IIMCN ZPHLZ VCROE MLDWR RRTOX CGTUG EXAVM XCREL XEIVL XPTHI BEQZS EMRLU GISJB JPIAM GILJM LJGDM FGWUA JPHUP BHRTL DBRCT UUCMM ZMSVT MVXDM RUGGI GKPEP XPAPV ZEQKE EBEMD NTORX XWTVG EMHEA AEKFR WVZWN EMIMN MEAZS IWLBC UGYHZ VZMNT LYMYW RVZTI LKWTE EESZV BTUKQ MLYMR ZKYEG UBHRO CZXJA EYHLG DSCTV TELXD MAAZT QXIVP NZCSE JEIYR HEMTP OHZQS KKPEO ULXBE KAFKT XBJQN IUWZX UQNGN PSIVZ AGOZR MYMAV XXMGZ ATEES EOVJE RTMVB VNEQU YSNIN IAJTR ZJAOS GCEGU PAIKP QIYIS VYPHM YMIZV ZVMRV CRUQT KFBEP ZTRZK PEEJQ WRJBE ZCSMV YQAZZ ZPWKP ELILP ETPAV TSSFV DKVYD CFGIT UKEMV SCTGN PXAIM EBLFW TIMSG OWPPF ZRVKO EUFCT GNPRX NIGRT EWXDJ EQJPH BETOA JZRTE LWRGC IGFBS HXPLH NUUPN ZJTKP RRGEX AVGPB YPMMZ ACEAN MTCBH NZHIU IMAXZ SITKB APNPH VZXHR XEIQK ISSGD XTJXO FYTFE VAOJK NEGGC TRLQI VKQVR IZYGK MRZKL WNIMS VTAPT TMIGO DXXDX TVTRX HRZRR YEEEC BWRTE CMYZE RYACV CQSGY LRWRA KGNPQ WZZEP ZWCUL BWVZS SNKZE IKLPB EOTUK PBMVV TBLZY KJCRI KTPER VCRGY HVFLE OXPED ZVGNH TPBKG IGCTP EEWTO KASLJ QBYKE SIIWV RZSEM KPELN LZXSZ OXKYX AVTAJ YZAXN WUYJY SMSMA ORPXH UMTNO YSKUM PBXEX AVUIG CZYEU CSHGW PRSMB RZEIK KWWNZ NLTEL WNOEF NKBHR GTVFZ VIFZC CYVML FZSEM KPEEO DOMFW UEGTV WVNEA IPMLK WOTXP EMJWW RTPIW KWAPZ QELKQ FJKVR XNMXN IEPRN PEAGY HPYMR RZSIR ZVTRT OIWKW AGZLG DTPAV TSSFV BHRTH IFZOH GHPEU CMTBO YGKVI SRYPG NIQTL ZZTKV DEAZT XULBA TGTRP VZIFQ CIOVI LVTRS NIKOH TEIKZ VTRRW MZVVC RILTT SQLVZ TILYI REEDY ZXMSG KOXAR BWRIZ YEUWB FIFVX FCRGX LGDJJ YSGVM GXIVV YTXUP LITTT XTIQE FZZXA VBAEM PXLZB EFGDE VFDEE YESKP NOEOY GKVIS RJDIV LZIGE MYMNM CNTEQ TZVTN OYXAV QNPXP ELVNO ERZRZ NQTUU FXKRQ SVTRW NJXIP OZRLF QTVYN VNTQA YZZHX KMRZO YIMYM IEVWE GJEHN ZPZXI BHRGM AXYZA EKTRM VVDVT RXAVG WBTEA TEBTU KTVTX MNGYE SYRTL VTESH LZHNT OWXJX EPOLP EPIFG KCEWV UOYOE MHEAI AIPXA RBWBA WHZZD EHYEL XVFCH YPAXE MEQZZ EKIMS GZSIF ZBWBA WHUVO OBJES DEWWJ NLXMY MYUGG IBEUI AJQSK KPEVX PBYZT TEGEM HEBHV TRWTI MVRXJ JBEML LHLPT EKEQO QAXRK TGUZW HFVWR MTZXR EALUF VVICC VGWEW MINGG RIBEB HROYX XIKEC ZHEKZ NWRGN XMFWL NZPSN IMNRS TILTW UYJDI KZWUF RJHTD IGRUF VTZZD RLPRV VKACG MMEZB YVZTW VCMAE ZSEMK PIAMD EKVKO ZOYKM FIHRG OEGUQ TVYNV NTQAY ZSEMN MCEGN OMYMC YUNOV ZXHRX LWLFW NNYAS LJQBY KELXW ITRUQ XAVKO HTEVR CQEFO YCHLZ HNTOW IVIRY
diff --git a/2020/ciphertext.7b.txt b/2020/ciphertext.7b.txt
new file mode 100644 (file)
index 0000000..d7f4ef5
--- /dev/null
@@ -0,0 +1 @@
+VXLKV ZXZSZ XODRQ YFQEM OLMRT OFATI MXTAW AYANK RBPCE SXCUP OB#RT BXSEK RDSJ+ WYTG+ JDIKP NRJTP #AFYX BAZRO VAWUH RUYIZ RCOSX CBNW# VNIQS XJPEU YKCJO PSMCE QXBIC #HYIZ T+RBJ +MXPM TDSKR UNQ#U BIHZX VBZET EGSZE MWXQD UFQXS EKRZD ENOND SZEQU IXNGL +REON AHUOQ +ULFN ELDQB HKZGS QPSMC NRQ#O LMEOP FXLBU LSY#I C+IO# SGRDL VIMFU MPOTL UPADT SCAUW MSJGX VHWAH CIWBN KAPIZ EMWPX DBLCP +H#KN RJTPZ ELNZA WZRKS HKNDS LHJNK VFQHM O#ATL SPISE JFSTD SPQYQ FQEGZ HLNDX Z+VKB +JKSD FWZAT UXH#K M#XNH XHZTL UKBTE BWDPU #APXB POTGZ CHODT SQGNB J#IVU VMZXV +PFAN TRILP EMHYO ERKAR T+YDJ WOIHU IZFTX LWUB+ ZGSLN QYT+R +THCH TPBXZ JVLDT EIWIH KNDA# IQYCL WJVMO PWRFT GKXCQ EHCNH MBEQ+ MPUCO DSOLD JWKSH KNDA# ILUXV TOCHC KUVQR FBXJT AZAKU FHIYT BJNMC HSOXL XYJKM ZJWMD UGNWP BWYRX ISFUL YNTBZ WZKTY GRY+R QVH#S W#QBF YXW+W ZSIAS TI+VR GPXQM XEVUK QXJGN IXBGH EWYIY WYSXB L+JWG ZCHOQ HZWLX QBHVJ ZSDKW RGFTU GXTGW #MEOT NTEJA QH#JE AJWRQ GVKYX N#LOZ WUZTW PHWXB MPT+D LVZXJ HIONA TEUQO SRDLW YR+CP VQENQ MENKX Z+UBX KSMTO JWMI+ SUJND JMXI# HPMEO WUXYJ ZXJPM IKRZI QCXBO #HYAI FDUVQ KUBNH YVHWP RBTCJ +MPOR QVNEG IVXYJ KCRUI ZQDIH PJVLU IVGJB VXYWS QNH#V YQCJP VMGOQ FMNCK XFLDT SGRAS RHWC# FOFAV LNBIF HNELJ BNHYE MIAPS MCJPY IWQJH VCWDU RFBRT BNBJA UKW+A SVCND JM+BP M#PLJ HLNVZ LUPAX PR+HN LR+DI VHGPA SPBNU HFOIH PZTYX NS+QA #VD+B PHGLE QROFX QRNYD FSFJO IXAI+ QEIEM EOTXL NJBZW SGSFA XUOQF P+MQP HULTE GHPZT HBJKT KVNHM BEQEI EKVUS EFLPJ HOK#T DIARY FQPBO CPOWS ROENQ IJ+WC JZTRW OAX+Y FQPBO CPOW# ANPIX ALTVW KSHXQ MCENG MEOHU QPXBE ROCKC R+VQS PIVNQ LBAIN WILDT #DRHK OXWDR XIWCP CUCPC UFYJB WHQXY PER+G A#INQ PBOCP OWHZT XTPZM WYWSV JA#YF QSH#X EUOCJ FULRO EILZI JZXOD HOAX+ WMT+Z QG+SR UGPQH RNLDT CRNIS RYTDL VGWXH #SCKU NENUK TJKPA WIXJS V#KME N#TQW IXBJ+ WKJWO XMDLG VPWKC KUENU IPGJR WMKNP RDHWD LPBOC POW#J QTEGB +EJSH WAYTQ YCLWA HVLSO RSUZX NJ+BT ESGRA SRXMQ X+SCT PMULN YDHFO VKSYC JDRQN FYFW+ DHXVH WLYWY QLXYJ ZXJEQ UI+LX MQSI# XMHCT OB#TY H#NIX JHY#H #NYI# V+IVG ZCHOW #QBTI LDTGN EVZDS JLHIJ MINR+ UIFLJ M#OWR FYX+Z SOJPU KCQYD LVTZW OQTNC UQDLD TVJWU +LQFP GQPXV BZDHR FVBLB +JPVY DXDYW MISVW APCJS CILJH FYLDT ZGXK# SZDMX UWTC+ BPECU IOWAQ WKGCQ SNDSA WOHMY WMIRC +BPMR CNZDU RFBRT BNHYO CKCRY TOQGX KXMCK PWRNQ RXKJT IXD+N ITRUW DQPFP U#NBN UTEGZ TSODH KYHIY WTCBO CAH#C IXNXV HEYXP MHKND A#IZQ #HUXV CKNAT BNTZG KSWQM UTRCP MPUSO W#ANK UOTYX MUNLY FP+TW BYPUL RSOKA +WZSI YDWYQ ESFJV COPB# HVNLP CTSRP SCASG YFQ+B IMKYB NW#HZ XBXSV XYJRN GLUXI SFULY ZIWRV +HPZS YJPEU YJFSY WNMST JVDZU FVTAN O#EMW AXHI+ RCHE+ OFOHR A#ANG XHPYX ETU+A XRQ+W SMPAH CNPZU +OPJN TVOCK CRVI+ RHFOF ANQLE O+UTE SXKWP JADPD LV#GZ QJSKI SE+MX SZESN YKWL# XHIYQ GIEME OFUHR TESNI SECAK SHW+I RYFQC #SMQJ QSWAQ WKGCT ZWNSD J+A#S U+QIH MKJMR FTOQS RFKXS BJXEK NVXOD JEVGP CIPBU FYXHP QBTGM SRASA IDPGQ PMSAI F#ANV ZXZSZ XODLH YDLVK PRWBP #HQEH IVZGR YDRGU WJU#+ H#PWT SZTXF TKAQN ZJPCU AKVNY RVNJ# TJMRF APFW# HZQL+ NBLPE ZTBJY EUPYR GIJHB GSRAV SFSBF OENB+ JOASA IASXM TCPVG ZHXFU TKUQT IGRKJ O#VGM V#QFP SCILW UXVKM IJUVH KGRVY QCJES XAMCK XFLDU QRSVW YRWKN FHV+N DJM+B PCHVS NFHRH LDSZE MWBDW DRXBV WGH#B VNELH SREAQ AXDIP VLH#O HORQV Q+JBN HYQTK CA#IL ULGVM KQGVY PBOFY XRHED #LWAP RIMDL VIMKN VLHUV BOBXS ACOVA HMHUY VNR+I TAWCL SCIL# ANVKY RQRQA XIMNU GVGZU CTONT ELZIY RPVYD MVMD+ BPRVS CIDLT WB+JU TDKNQ HV+DL VUHUL BI#JH ZTEGB +NVAK UMRQD OR#FA PMEOL FQ#VT SZXOD KCQYI MNUGV TGZUC #AHRS OKA+W AYW+O AX+YF QMFOF LPBO+ OFUQN HYMIO LRYI+ SI#PA CKXFA JKISE RMXKP EQT+G BRYFQ JM+IW OLFVH K#YQL FYXSZ ERWXI OSYQT RCPIK PJXVC KXZNW HPHYP EUYKC RPNUI QPJMC KXFJV RQKDT KJ+AX YHTDQ HWTGW UC#XN PFYXT CUVDF OAIVW NDJGH #KONB US+VK QNZJP UYW+S GRPVJ GMQAR #NZIZ ULDTZ GRNWO FXDTU GZSMG ZORQH ZUJUZ EWX#H OAX+Y FQXNC #R#C# UTPIQ +HQD# HWAH+ CTJRS XMFIW #RTLB +JERA SRYNR CHE+O FOHRA #ANJB ZWSNP UKCQY PTUVH #RWLP #QLUR JZMOH BJUSD KOQGB JPWVO EQFUB NWRNI QOJYE U#A#I NQPXC VCXW# QBDVA YHIXY JKCRX +I+P+ ISFME OWX+Q FTUXB TWUPH CNHMB +QCEV YGRJW #QUXB +JKQT KCA#I NUMCW CMCOX VRTLB +JGON WNFYF Q#JPO LWCMS HFSBZ XJ+NJ MXYPU PA#TV CZJ#T GW#UJ DIXFS OKAQB SACFQ AX+WV WOSXO LBJLX FLDZT JMOKE IHWKR G#PCN HMUJH UIZ+W UB+WM R+GBV QS+QC EVYGR JWQDV KTZGX KESW+ NGYFQ +BIMG PHLCK JANEL DTVJR ARCO# XOCZL H+PAV OD+VW KQBHK ROVQT +G+RI Z+SVU VLNUN URILP SCHWE WIDQB MITBP OC#XP BOJVR JAYHQ EKNTI Q+IGJ MRFCK ULNJZ TBJKI NI+VF SUFWM IDVTJ HBSPB #AHRE XUX+# OVACN XBPCE NPCHU IVPXK MVZJR +J+WX MQHZG PCMEO ILULT LUPAV ZOATK XSRFD BVPLB OWRIX JQKSK CQYTE +HI#Q FPRBU HZT+F JKJT+ HIJZS AVWXH UYBTQ DVMUM EVLHJ UXJKB HKEJZ SDKOH UGRPI SFVLN YCXZX NV+B+ JOASA IASXM NDJMI EMEVS QHRIU PAVQS WSWLU YFQCI GNQLB DOIZK SJHSZ ESANF BPOTA PEWCH CKUST BMXNU KQSAC IUPYA #DIQP SRCUA HSPBE QEGPA IXD+Y GQPVQ +UVRH FMWBO PBNQV BGUKS ZXYJU PYSGY IC#IV HLUOU YDVBL QCT+N ACJYS NQGSG INX+S CNPZU MO+UN EWJBJ +NATR DFGSU YIMRC QHU#O ASEKS +PZQN TYPEM IAYFQ JMVMO MVRBN QWKGD SBJFS W+IXJ G+JWQ JHYXZ +JQSE JPV+K NFYFT NQV#J XQCVO WJUAT FXMNV SOZSA WLVMQ UGW#J HUFUF TUXKJ RNYOQ DU+MP ZH+BP UO#IZ JPMPQ VPEUY VWCQA IEQV# XFUYB O#QOE +UABE WESKC JOWDT UMKXM VCPWP ZQSEL DSZEM WGRVB I+RXT WIOIZ NWUB+ ZGSTD JASVC LH#KM EN#FY XWSEJ ERXJ+ WYFQ# VOKWL SPOZT KIUKB TYDTS RGQIN DJM+B PZHNY IYFYX JHQYE SAJ+A RMCRQ PFOHD FXZXY RQTVZ GSRNL RGVJQ MVOCB NBDSN WUAY# JURXJ +WIYQ GOVZE WCMCI DHRXV FXZ+J KTFW+ ASYPN DJMUB IFPME ODUXK JZSZX ODU#P QDVMZ +BPAH SCFSN FOVKP GZGSA F#OVU YIJPG VGZHU OB#LT KNPSY VOCKC JOX+I +P+IS FMEOZ IZ+VK BEXRD SGRHW C#KVR PNCIU ZRWBU KXWMD OQU#C JW#NO VCR+O I#GPL BPONE TXBHX YCUAX NHDZP +GLHF ZXZRI LPERN ZGOVK A#IW+ VJWRT LPNTL UPAVI JQT+G BROMP E#VGW IRBHF VBMZN ZXPMY GQGUG #HPI# VPOFV TEANB JPRKP +GIVQ XTOCN #PWPR FVZUG ZGSAW JOQGP QFPCP VGZUC QUVGN BIPGR OVASY XOGVJ NFKYH UXBFW BXMWY #TDKW YDTIH GPACK UZJVR Q+HQD #ILQG BTC+B PJUYR CNHUQ BNBJB NHYRD FYRYO +C+SG QCFP# GWDXZ QBHKA KUKWI YWMI+ BPQAH LCP#T QDLDT ZKTI+ WMIWN JZEU# HFUTL XZYHY JKWYT WJGJG +H#HP MRJWR FVZWX JWYCT DFNA# I+OPO TGW#C RMIPN LDTIW KFPAP RHTU# EZI#K QMIR# ODHD+ UJQDE KNRGU O+Q+B OMXHU XZSOE UBRNZ GOVKI +RYHT +WJZO VHLCW HZFYX JWATK IGOAX +YFQS ITJVR BJHEK MXZTX WK#SF QUVNU VPVTJ RBEJO +RTSR DSHQD VMDQV GZHV# SNAUF JILPE BHXYW AWQUI DLVTP OJFHF JV+B+ JDODF NGY+R H#VLH VCPWN LWXOJ AB+WE KCRQC TVWPI CZH#Y OCHXN JKMZG SIOUT VRHGP AUIDU GVPUV KSIRC NHDCT CESFU POB#R ILPEB +J#SE JIRQP C#SGA PUBZI JU+LP GWD+J +AXIM QSOBO FASNB DFYOI HIVZ# JEMWA X+G+R JGIGU JMRFP YJVRJ ZTSRY KPYRB DLV#G ZHUID UGVPU SODKI J+SGR DLVRP NSCI# ANTUE +JKNP OABRB INDGS UPASC ILHFO IEZNA ZJ#U+ O+IVR HFCO# H#CKX FIDPI YCJRH JGVLS UNJF+ PYJ#H FXJKS YVOFS TDSRU YIZRZ #POHS WXLJI LPER+ JYVHJ +WYFQ SHPBI #PMUQ ONTBX BHJKR HWA#I VRMBP CUBFK X+UFT DLXZI VJRDF AXBIC Q+VGZ HQOTY LVHB+ JWUFW BXTW+ SPFJT #O#AT LKPHY SPORU YFQXH WPIHX #JHXN ILPEB +NVIX D+IGO XDIZN PVGZH #PWPQ DLDTU JISFI S+FQG ZOLBP BOHZF VXKTO RGRDF OUYTG RZHUF CJFUT ZETWK PTNXS GIMD+ BPFTS OIZNV +B+JP MIDRB VLHMV HSCID URFBP WZGSF WKSQI G+QBV MOALN YJFTH ZUOLB HTSKC RDHWD L+BPO ENFON LPNAS KSIOR YFQEV TGCTO CPCUB VWXZS ACURX WJA#V +ZQG+ SMPOR BW#LW XLQBH KJZSA QNGIW MDLVW S+PRH LCTPZ EGNZB JWNAT CUAQN HDUOQ VQXTO FAXIS LXVRZ SXJRD FIXJS IGRHL C#QFY X+SZG SAGQG BOR#F AP#CU VSODY QLNFX ZQBHK ROVRA WQGWM NMIMO MVRB# QWIJA YVZOA QTHCJ +WPTU #NPRQ FMEOA PBXEB YJQTH MEMWN DRDVD RJ#TG W#NRJ FWSZX KXRNY GS+N
diff --git a/2020/plaintext.7a.txt b/2020/plaintext.7a.txt
new file mode 100644 (file)
index 0000000..95c5849
--- /dev/null
@@ -0,0 +1,30 @@
+the attached document was intercepted by harry steam who have managed to plant a bug on the
+communication lines out of tirpitz ufer our crypt analysts have examined the ciphertext and the case
+files and believe that it maybe related to the wheatstone clock cipher deputy head of the division
+has written a boss guide to these cipher machines and we have added that to the case files harry
+steam also recovered a scrap of burnt paper from the abwehr hq waste which carries the following
+message which we think might be part of the plaintext tential stop the tripwire option is also
+deprecated since it is more likely that the expl the navy reported that a dutch fishing vessel was
+impounded by the nazi authorities in bremerhaven the crew were detained and negotiations are
+underway between the dutch and german authorities to try to get the fishermen and their vessel back
+but in the meantime rn patrols will watch out for the boat in case it is involved in the operation
+the air ministry have been briefed on our findings so far and have emphasised the importance of
+protecting the rdf system which i am told they call chain home vk is sympathetic but the three of us
+are still worried about the new agents embedded in london and we are not sure how much of a threat
+they pose it is crucial that we break the attached ciphertext as fast as possible so we can put
+effective countermeasures in place it is tempting to arrest all twenty three spy c lists and ask
+them directly but without revealing the extent of our surveillance and code breaking ability it will
+not be possible to prove that they have broken the law so we would not be able to detain or deport
+them it would usually be better to watch and wait but the air ministry feels that the risk to our
+air defence is too great so we need to act fast if we knew exactly when and where they intended to
+attack chain home then we might be able to increase security to prevent it but again we risk
+revealing our counterintelligence capabilities harry suggested that we could obscure our tracks by
+faking a visit by dignitaries to the target sites as a coverstory for increased security but we cant
+maintain the increase for long without raising suspicion so it is crucial to determine their plans
+whatever the abwehr are intending they wont want their agents to fall into our hands especially
+after a demolition since that would give us the excuse we need to arrest them it would be good to
+know what they have in mind for their exfiltration things are very finely balanced if we act too
+soon we giveaway our crucial advantage in the intercept war if we act too late our enemies could
+seriously damage our air defence capability it is clear that things are coming to ahead and it is
+crucial that we crack the clock cipher as soon as possible the fate of the country lies in your
+hands pearl
\ No newline at end of file
diff --git a/2020/plaintext.7b.txt b/2020/plaintext.7b.txt
new file mode 100644 (file)
index 0000000..9feae4e
--- /dev/null
@@ -0,0 +1,75 @@
+karl operation cathedral tower has been approved and our agents are arranging to provide you with
+the tnt you requested in your last messages top this will be shipped on a dutch fishing vessel which
+will land at the marshes of fold leigh at two am on friday december tenth stop they will signal
+their arrival by flashing their navigation lights in morsecode to spell out the word flat and you
+will reply tyres top if you believe that you are being watched then abandon the rendezvous and try
+again at intervals of two days three days five days and seven days stop do not attempt to make
+contact with the boat or it screw in any other ways top the explosive is stable but should be
+treated with care stop the fuses are the most recent product of our research and technology division
+and carry triple triggers stop they have a timer circuit which maybe set for any period from three
+minutes to seventeen hours stop they can also be triggered by a tripwire assembly or the fuse
+mechanism can be replaced with a hand grenade mechanisms top since these charges have been shaped
+for demolition use we do not recommend using these devices in combat since you have no certainty
+that the charge will land in an orientation that will maximise its destructive potential stop the
+tripwire option is also deprecated since it is more likely that the explosives will be discovered if
+they are attached to such a trigger and moreover it would be difficult to coordinate the charges
+using such a devices top the charges themselves are small but the geometry of the package will focus
+the blast so it is imperative that you install these charges in accordance with the manufacturers
+instructions stop in order to maximise the damage to the towers the engineers recommend that you set
+charges on three of the legs of each tower with charges two and three set to explode in sequence
+after charge one stop set an additional delay of thirty seconds for charge two and one minute twenty
+five seconds for charge three stop as the first leg buckles it will stress the frame so that the
+shockwave of the second charge will distort the supporting members stop with the third explosion the
+frame should buckle resulting in the total destruction of the towers but this sequence will make
+site clearance and reconstruction harder to accomplish stop the delay with charge three also
+increases the likelihood that soldiers will have arrived on site in time to be caught in the third
+blast increasing confusion and loss of morales top if it is possible to climb the tower in advance
+of the demolition to get more detailed images of the aerial and amplifier circuitry then this should
+be attempted however if there is any guard presence then no risks should be taken in this regards
+top we must leave it to you to determine the most effective targets for the operation but the
+demolition must happen simultaneously at all sites for two reasons stop first in order to prevent
+our enemy from disrupting the operation once they realise what is happenings top second we must
+leave no doubt that this was an act of wars top there is a risk that the british government may try
+to reach an accommodation with the fuhrer dividing the world between their dying empire and ours
+just as it is born stop the only way to ensure that we can truly supplant them is to draw them into
+a war they can not win and this project will be the provocation that ensures that this will happens
+top the planning division has determined that january first will be the optimal night for the attack
+as it coincides with a new moon stop they suggest that you split into two teams to attack the
+edmunds t caistor and ca new don sites opening a corridor along the thames for our forthcoming air
+raids stop the support teams should setup lookout posts at the targets in advance of the attack so
+that you can monitor guard movements and make a final assessment of the security stop following the
+operation the sabotage teams should rendezvous together with the support teams at the home of the
+local orts gruppe chief in south maldon stop au boat will standby to pick you all up at three forty
+seven january second with a fallback rendezvous of one thirteen on the thirteenth when the search
+should have died down stop you will need to gain access to a boat capable of carrying you all out to
+meet its top there are very many fishing vessels in this neighbourhood and we recommend stealing one
+after the operations top it might feel less secure that obtaining one in advance however we must do
+everything we can to prevent suspicion in advance of the operations top if this mission succeeds
+then it will be only a matter of days before the war begins and your three comrades in london will
+playa crucial role in coordinating our intelligence efforts behind enemy lines stop we have been
+watching and listening carefully for signs that the operation could have been compromised and as a
+result of those enquiries we have discovered a new top secret agency known only by the acronym boss
+stop we have been unable to infiltrate this group but it is known that the leader is someone with
+the initial hand that they are taking the lead on signals intelligence stop the head of the
+counterintelligence branch uses the codename pearl and we will be making every effort to discover
+her identity stop while the declaration of war and the destruction of the rdf system are the central
+goals of this operation the london triangle will be key to ensuring a flow of high quality
+intelligence to inform our battle plans stop without their communications we will be unable to
+monitor british plans placing german lives at unnecessary risks top if there is any chance that
+members of your group could be captured and interrogated then you should abandon the sabotage
+operation and return to tirpitz ufer stop protecting the identity of the triangle is of far greater
+longterm importance to us stop we can find other ways to provoke the war but we would find it more
+difficult to ensure that we can win it without a network of agents in the capital stop the mission
+will be regarded as a success only if we can guarantee their safety stop to increase the security of
+the london triangle it is crucial that the clock cipher device and the associated code books reach
+our london agents stop the device can not be allowed to fall into enemy hands and this must be the
+top priority stop if you are captured then the codebook containing the keys to the cipher must be
+destroyed stop it is printed on special paper that should easily dissolve but it can also be
+ingested if necessary stop when using the machine take care to erase the cipher alphabet after use
+and to delete the key from the codebook to ensure that no one uses the same key twice stop this will
+also reduce the risk of the keyed cipher falling into enemy hands stop if capture appears imminent
+then use one of the shaped charges to destroy the device preferably burying it together with the
+charge to increase the destructive power and make it harder to reconstruct stop everyone in the
+movement will be praying for your success and your courage and commitment to the fatherland will be
+praised forever stop you are an inspiration to us all stop wishing you luck in the final phase of
+the operations top yours uncle wilhelm
\ No newline at end of file