Merge branch 'simulated-annealing-testing'
authorNeil Smith <neil.git@njae.me.uk>
Sat, 9 Nov 2019 19:50:47 +0000 (19:50 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Sat, 9 Nov 2019 19:50:47 +0000 (19:50 +0000)
21 files changed:
2019/1a.ciphertext [new file with mode: 0644]
2019/1a.plaintext [new file with mode: 0644]
2019/1b.ciphertext [new file with mode: 0644]
2019/1b.plaintext [new file with mode: 0644]
2019/2019-challenge1.ipynb [new file with mode: 0644]
2019/2019-challenge2.ipynb [new file with mode: 0644]
2019/2019-challenge3.ipynb [new file with mode: 0644]
2019/2019-challenge4.ipynb [new file with mode: 0644]
2019/2a.ciphertext [new file with mode: 0644]
2019/2a.plaintext [new file with mode: 0644]
2019/2b.ciphertext [new file with mode: 0644]
2019/2b.plaintext [new file with mode: 0644]
2019/3a.ciphertext [new file with mode: 0644]
2019/3a.plaintext [new file with mode: 0644]
2019/3b.ciphertext [new file with mode: 0644]
2019/3b.plaintext [new file with mode: 0644]
2019/4a.ciphertext [new file with mode: 0644]
2019/4a.plaintext [new file with mode: 0644]
2019/4b.ciphertext [new file with mode: 0644]
2019/4b.plaintext [new file with mode: 0644]
cipher/keyword_cipher.py

diff --git a/2019/1a.ciphertext b/2019/1a.ciphertext
new file mode 100644 (file)
index 0000000..e415352
--- /dev/null
@@ -0,0 +1,6 @@
+XQHHO, Y QC DEJ IKHU YV OEK MUHU SEFYUT YD JE JXU CUCE QREKJ HUSUDJ ULUDJI RKJ XUHU YI Q IKCCQHO.
+JME TQOI QWE, QD EVV-TKJO WKYTQDSU EVVYSUH QBUHJUT CYIIYED SEDJHEB JE Q FEJUDJYQB FHERBUC MYJX JXU QFEBBE VBYWXJ. JXU FBQDDUT TUISUDJ JHQZUSJEHO QFFUQHUT JE RU HKDDYDW ED Q SEBBYIYED SEKHIU MYJX JXU IELYUJ BKDQH EHRYJUH BKDQ-VYVJUUD, QDT JXUHU MQI QJ BUQIJ JXU FEJUDJYQB VEH JXYI JE SQKIU QD QREHJ, EH, MEHIU QD QSSYTUDJ. REHCQD JUBUNUT CEISEM QDT QIAUT VEH Q LQHYQJYED EV EHRYJ QDT, FHUJJO CKSX JE ULUHOEDU’I IKHFHYIU, JXUO QWHUUT. QI Q HUIKBJ, JXU CYIIYED YI FHESUUTYDW QI FBQDDUT.
+DE EDU YI HUQBBO IKHU MXO JXU IELYUJI QWHUUT JE XUBF, WYLUD JXQJ QREHJYDW YJ MEKBT XQLU FKJ UWW ED EKH VQSUI, RKJ JXQJ GKUIJYED YI EDU VEH JXU QDQBOIJI QJ BQDWBUO. Q CEHU YCCUTYQJU SEDSUHD VEH CU MQI MXO JXU FHERBUC XQTD’J RUUD IFEJJUT UQHBYUH. VHQDA JEBT CU JXQJ YV XU XQT ADEMD YD JYCU JXUD MU SEKBT XQLU FBQDDUT JXU EHRYJ QDT TUISUDJ JE QLEYT JXU YIIKU YD JXU VYHIJ FBQSU.
+EV SEKHIU, CYIJQAUI TE XQFFUD, RKJ Y SXUSAUT MYJX JXU JUQC QDT EDU EV JXUC HUSQBBUT HKDDYDW IYCKBQJYEDI ED JXYI BQIJ CEDJX. IXU IQYT IXU XQT VBQWWUT JXU YIIKU VEH JXU QJJUDJYED EV VBYWXJ SEDJHEB, RKJ DE-EDU JXUHU HUCUCRUHUT IUUYDW YJ. Y QIAUT JE IUU JXU VYBU RKJ YJ BEEAI BYAU Q RKDSX EV WQHRQWU, MXYSX, Y QIIKCU, YI MXO DE-EDU HUIFEDTUT JE YJ. JXU SECFKJUH JUQC TED’J HUSEWDYIU JXU VEHCQJ QDT JXUO IKWWUIJUT JXQJ YJ MQI FHERQRBO ZKIJ Q RKW YD JXU HUFEHJ MHYJYDW IEVJMQHU, RKJ DE-EDU HUSQBBI IUUYDW QDOJXYDW BYAU YJ RUVEHU QDT YJ YI MEHHOYDW JXQJ JXYI SEKBT XQLU RUUD IE IUHYEKI. SEKBT OEK JQAU Q BEEA QJ JXU VYBU QDT BUJ CU ADEM MXQJ OEK IUU?
+CUW.
+FI MXUD OEK QHU FBQDDYDW JE WUJ RQSA XUHU VHEC XKDJILYBBU?
diff --git a/2019/1a.plaintext b/2019/1a.plaintext
new file mode 100644 (file)
index 0000000..376da63
--- /dev/null
@@ -0,0 +1,6 @@
+HARRY, I AM NOT SURE IF YOU WERE COPIED IN TO THE MEMO ABOUT RECENT EVENTS BUT HERE IS A SUMMARY.
+TWO DAYS AGO, AN OFF-DUTY GUIDANCE OFFICER ALERTED MISSION CONTROL TO A POTENTIAL PROBLEM WITH THE APOLLO FLIGHT. THE PLANNED DESCENT TRAJECTORY APPEARED TO BE RUNNING ON A COLLISION COURSE WITH THE SOVIET LUNAR ORBITER LUNA-FIFTEEN, AND THERE WAS AT LEAST THE POTENTIAL FOR THIS TO CAUSE AN ABORT, OR, WORSE AN ACCIDENT. BORMAN TELEXED MOSCOW AND ASKED FOR A VARIATION OF ORBIT AND, PRETTY MUCH TO EVERYONE'S SURPRISE, THEY AGREED. AS A RESULT, THE MISSION IS PROCEEDING AS PLANNED.
+NO ONE IS REALLY SURE WHY THE SOVIETS AGREED TO HELP, GIVEN THAT ABORTING IT WOULD HAVE PUT EGG ON OUR FACES, BUT THAT QUESTION IS ONE FOR THE ANALYSTS AT LANGLEY. A MORE IMMEDIATE CONCERN FOR ME WAS WHY THE PROBLEM HADN'T BEEN SPOTTED EARLIER. FRANK TOLD ME THAT IF HE HAD KNOWN IN TIME THEN WE COULD HAVE PLANNED THE ORBIT AND DESCENT TO AVOID THE ISSUE IN THE FIRST PLACE.
+OF COURSE, MISTAKES DO HAPPEN, BUT I CHECKED WITH THE TEAM AND ONE OF THEM RECALLED RUNNING SIMULATIONS ON THIS LAST MONTH. SHE SAID SHE HAD FLAGGED THE ISSUE FOR THE ATTENTION OF FLIGHT CONTROL, BUT NO-ONE THERE REMEMBERED SEEING IT. I ASKED TO SEE THE FILE BUT IT LOOKS LIKE A BUNCH OF GARBAGE, WHICH, I ASSUME, IS WHY NO-ONE RESPONDED TO IT. THE COMPUTER TEAM DON'T RECOGNISE THE FORMAT AND THEY SUGGESTED THAT IT WAS PROBABLY JUST A BUG IN THE REPORT WRITING SOFTWARE, BUT NO-ONE RECALLS SEEING ANYTHING LIKE IT BEFORE AND IT IS WORRYING THAT THIS COULD HAVE BEEN SO SERIOUS. COULD YOU TAKE A LOOK AT THE FILE AND LET ME KNOW WHAT YOU SEE?
+MEG.
+PS WHEN YOU ARE PLANNING TO GET BACK HERE FROM HUNTSVILLE?
diff --git a/2019/1b.ciphertext b/2019/1b.ciphertext
new file mode 100644 (file)
index 0000000..819e0c0
--- /dev/null
@@ -0,0 +1,11 @@
+ZRZB
+SEBZ: GENWRPGBEL GRNZ NCBYYB THVQNAPR
+GB: THVQNAPR BSSVPRE
+FHOWRPG: UNMNEQF VA YHANE BEOVG
+ENQNE GENPXVAT UNF FUBJA GUNG GUR FBIVRG YHANE BEOVGRE YHAN SVSGRRA VF CBGRAGVNYYL BA N PBYYVFVBA PBHEFR JVGU GUR FPURQHYRQ QRFPRAG CNGU SBE RNTYR. GUR PHEERAG EVFX VF YBJ GB ZRQVHZ, OHG NPGVBA FUBHYQ OR GNXRA GB ZVAVZVFR BE RYVZVANGR VG.
+GUR PHEERAG ENATR BS BCGVBAF VAPYHQRF:
+ER-PNYPHYNGVBA BS NYGREANGVIR QRFPRAG CNGUF GB GUR CEVZNEL NAQ FRPBAQNEL YNAQVAT GNETRGF.
+ER-QRFVTANGVBA BS YNAQVAT FVGRF JUVPU HFR QRFPRAG CNGUF JUVPU QB ABG VAGREFRPG GUR BEOVGRE CNGU.
+NOBEG ZVFFVBA
+GUR SVEFG NAQ FRPBAQ BCGVBAF PNEEL GUR NQQVGVBANY EVFXF NFFBPVNGRQ JVGU NAL FVTAVSVPNAG YNGR FGNTR PUNATR GB GUR ZVFFVBA CYNA. GUR GUVEQ BCGVBA PNEEVRF GUR ERNY GUERNG GUNG JR JVYY SNVY GB SHYSVY GUR CEVZNEL BOWRPGVIR BS N ZNAARQ YNAQVAT ORSBER GUR RAQ BS GUR LRNE.
+BAR NYGREANGVIR GB GURFR BCGVBAF JBHYQ OR GB ERDHRFG SHEGURE VASBEZNGVBA SEBZ GUR FBIVRGF GB PYNEVSL GUR ZVFFVBA CYNA SBE GURVE BEOVGRE. VG VF CBFFVOYR GUNG GURL NER NYERNQL CYNAAVAT GB ZBQVSL VGF GENWRPGBEL NAQ GUNG AB SHEGURE NPGVBA JVYY OR ARRQRQ BA BHE CNEG, OHG PUNATRF GB GUR BEOVG PBHYQ VAPERNFR GUR EVFX NAQ JR ZVTUG YBFR GENPXVAT ERQHPVAT GUR YVXRYVUBBQ GUNG JR PNA ZNANTR GUR FVGHNGVBA.
diff --git a/2019/1b.plaintext b/2019/1b.plaintext
new file mode 100644 (file)
index 0000000..ac69d0e
--- /dev/null
@@ -0,0 +1,11 @@
+MEMO
+FROM: TRAJECTORY TEAM APOLLO GUIDANCE
+TO: GUIDANCE OFFICER
+SUBJECT: HAZARDS IN LUNAR ORBIT
+RADAR TRACKING HAS SHOWN THAT THE SOVIET LUNAR ORBITER LUNA FIFTEEN IS POTENTIALLY ON A COLLISION COURSE WITH THE SCHEDULED DESCENT PATH FOR EAGLE. THE CURRENT RISK IS LOW TO MEDIUM, BUT ACTION SHOULD BE TAKEN TO MINIMISE OR ELIMINATE IT.
+THE CURRENT RANGE OF OPTIONS INCLUDES:
+RE-CALCULATION OF ALTERNATIVE DESCENT PATHS TO THE PRIMARY AND SECONDARY LANDING TARGETS.
+RE-DESIGNATION OF LANDING SITES WHICH USE DESCENT PATHS WHICH DO NOT INTERSECT THE ORBITER PATH.
+ABORT MISSION
+THE FIRST AND SECOND OPTIONS CARRY THE ADDITIONAL RISKS ASSOCIATED WITH ANY SIGNIFICANT LATE STAGE CHANGE TO THE MISSION PLAN. THE THIRD OPTION CARRIES THE REAL THREAT THAT WE WILL FAIL TO FULFIL THE PRIMARY OBJECTIVE OF A MANNED LANDING BEFORE THE END OF THE YEAR.
+ONE ALTERNATIVE TO THESE OPTIONS WOULD BE TO REQUEST FURTHER INFORMATION FROM THE SOVIETS TO CLARIFY THE MISSION PLAN FOR THEIR ORBITER. IT IS POSSIBLE THAT THEY ARE ALREADY PLANNING TO MODIFY ITS TRAJECTORY AND THAT NO FURTHER ACTION WILL BE NEEDED ON OUR PART, BUT CHANGES TO THE ORBIT COULD INCREASE THE RISK AND WE MIGHT LOSE TRACKING REDUCING THE LIKELIHOOD THAT WE CAN MANAGE THE SITUATION.
diff --git a/2019/2019-challenge1.ipynb b/2019/2019-challenge1.ipynb
new file mode 100644 (file)
index 0000000..bfe893f
--- /dev/null
@@ -0,0 +1,159 @@
+{
+ "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": 2,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from cipher.caesar import *\n",
+    "from support.text_prettify import *"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "c1a = open('1a.ciphertext').read()\n",
+    "c1b = open('1b.ciphertext').read()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "HARRY, I AM NOT SURE IF YOU WERE COPIED IN TO THE MEMO ABOUT RECENT EVENTS BUT HERE IS A SUMMARY.\n",
+      "TWO DAYS AGO, AN OFF-DUTY GUIDANCE OFFICER ALERTED MISSION CONTROL TO A POTENTIAL PROBLEM WITH THE APOLLO FLIGHT. THE PLANNED DESCENT TRAJECTORY APPEARED TO BE RUNNING ON A COLLISION COURSE WITH THE SOVIET LUNAR ORBITER LUNA-FIFTEEN, AND THERE WAS AT LEAST THE POTENTIAL FOR THIS TO CAUSE AN ABORT, OR, WORSE AN ACCIDENT. BORMAN TELEXED MOSCOW AND ASKED FOR A VARIATION OF ORBIT AND, PRETTY MUCH TO EVERYONE'S SURPRISE, THEY AGREED. AS A RESULT, THE MISSION IS PROCEEDING AS PLANNED.\n",
+      "NO ONE IS REALLY SURE WHY THE SOVIETS AGREED TO HELP, GIVEN THAT ABORTING IT WOULD HAVE PUT EGG ON OUR FACES, BUT THAT QUESTION IS ONE FOR THE ANALYSTS AT LANGLEY. A MORE IMMEDIATE CONCERN FOR ME WAS WHY THE PROBLEM HADN'T BEEN SPOTTED EARLIER. FRANK TOLD ME THAT IF HE HAD KNOWN IN TIME THEN WE COULD HAVE PLANNED THE ORBIT AND DESCENT TO AVOID THE ISSUE IN THE FIRST PLACE.\n",
+      "OF COURSE, MISTAKES DO HAPPEN, BUT I CHECKED WITH THE TEAM AND ONE OF THEM RECALLED RUNNING SIMULATIONS ON THIS LAST MONTH. SHE SAID SHE HAD FLAGGED THE ISSUE FOR THE ATTENTION OF FLIGHT CONTROL, BUT NO-ONE THERE REMEMBERED SEEING IT. I ASKED TO SEE THE FILE BUT IT LOOKS LIKE A BUNCH OF GARBAGE, WHICH, I ASSUME, IS WHY NO-ONE RESPONDED TO IT. THE COMPUTER TEAM DON'T RECOGNISE THE FORMAT AND THEY SUGGESTED THAT IT WAS PROBABLY JUST A BUG IN THE REPORT WRITING SOFTWARE, BUT NO-ONE RECALLS SEEING ANYTHING LIKE IT BEFORE AND IT IS WORRYING THAT THIS COULD HAVE BEEN SO SERIOUS. COULD YOU TAKE A LOOK AT THE FILE AND LET ME KNOW WHAT YOU SEE?\n",
+      "MEG.\n",
+      "PS WHEN YOU ARE PLANNING TO GET BACK HERE FROM HUNTSVILLE?\n",
+      "\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "1666"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "key_a, score_a = caesar_break(c1a)\n",
+    "print(caesar_decipher(c1a, key_a))\n",
+    "open('1a.plaintext', 'w').write(caesar_decipher(c1a, key_a))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "MEMO\n",
+      "FROM: TRAJECTORY TEAM APOLLO GUIDANCE\n",
+      "TO: GUIDANCE OFFICER\n",
+      "SUBJECT: HAZARDS IN LUNAR ORBIT\n",
+      "RADAR TRACKING HAS SHOWN THAT THE SOVIET LUNAR ORBITER LUNA FIFTEEN IS POTENTIALLY ON A COLLISION COURSE WITH THE SCHEDULED DESCENT PATH FOR EAGLE. THE CURRENT RISK IS LOW TO MEDIUM, BUT ACTION SHOULD BE TAKEN TO MINIMISE OR ELIMINATE IT.\n",
+      "THE CURRENT RANGE OF OPTIONS INCLUDES:\n",
+      "RE-CALCULATION OF ALTERNATIVE DESCENT PATHS TO THE PRIMARY AND SECONDARY LANDING TARGETS.\n",
+      "RE-DESIGNATION OF LANDING SITES WHICH USE DESCENT PATHS WHICH DO NOT INTERSECT THE ORBITER PATH.\n",
+      "ABORT MISSION\n",
+      "THE FIRST AND SECOND OPTIONS CARRY THE ADDITIONAL RISKS ASSOCIATED WITH ANY SIGNIFICANT LATE STAGE CHANGE TO THE MISSION PLAN. THE THIRD OPTION CARRIES THE REAL THREAT THAT WE WILL FAIL TO FULFIL THE PRIMARY OBJECTIVE OF A MANNED LANDING BEFORE THE END OF THE YEAR.\n",
+      "ONE ALTERNATIVE TO THESE OPTIONS WOULD BE TO REQUEST FURTHER INFORMATION FROM THE SOVIETS TO CLARIFY THE MISSION PLAN FOR THEIR ORBITER. IT IS POSSIBLE THAT THEY ARE ALREADY PLANNING TO MODIFY ITS TRAJECTORY AND THAT NO FURTHER ACTION WILL BE NEEDED ON OUR PART, BUT CHANGES TO THE ORBIT COULD INCREASE THE RISK AND WE MIGHT LOSE TRACKING REDUCING THE LIKELIHOOD THAT WE CAN MANAGE THE SITUATION.\n",
+      "\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "1238"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "key_b, score_b = caesar_break(c1b)\n",
+    "print(caesar_decipher(c1b, key_b))\n",
+    "open('1b.plaintext', 'w').write(caesar_decipher(c1b, key_b))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(16, 13)"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "key_a, key_b"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/2019/2019-challenge2.ipynb b/2019/2019-challenge2.ipynb
new file mode 100644 (file)
index 0000000..4ec93e1
--- /dev/null
@@ -0,0 +1,172 @@
+{
+ "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": 9,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from cipher.caesar import *\n",
+    "from cipher.affine import *\n",
+    "from support.text_prettify import *"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "ca = open('2a.ciphertext').read()\n",
+    "cb = open('2b.ciphertext').read()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "11 7 True \n",
+      "\n",
+      "Meg, I took a look at the file you sent over and it was just a rotation cipher applied to the text.\n",
+      "At first it was hard to say if that was a bug or a feature and normally I would assume bug, but it\n",
+      "seemed odd that it was the only file that was affected so I asked around to see if anyone had seen\n",
+      "anything similar. It turns out that this was not the first navigation problem to hit the programme.\n",
+      "Gene reported a major issue with the guidance programme for Snoopy on the Apollo Ten mission which\n",
+      "could again have caused a major problem. For some reason the programme controlling the landing radar\n",
+      "wasn’t updated with the flight plan and if Gene hadn’t raised that with Iverson then the boys might\n",
+      "have had real trouble getting back. I looked through the company files and found another of our\n",
+      "mysteriously formatted reports: the memo informing them about the change, which explains why the\n",
+      "programme never got updated. This time the cipher was an affine shift, so slightly harder to crack,\n",
+      "but nothing serious. Still, it is much less likely that it was a bug that time, and in any case\n",
+      "twice is too much of a coincidence. It did start me wondering why the second cipher was easier to\n",
+      "crack than the first, but then I realised that the affine shift was too much of a giveaway. A\n",
+      "rotation cipher really could just be an encoding error, but the affine shift is too sophisticated\n",
+      "for a mistake, so whoever mangled the reports must have realised they had made a bit of an error\n",
+      "with the first one and tried to cover their steps with the second. It is hard to see this as\n",
+      "anything other than attempted sabotage, but I am not sure what the motive could be. I doubt it is\n",
+      "personal. The Apollo Ten and Eleven crews don’t overlap, so either someone has a grudge against the\n",
+      "whole Astronaut corps or they are trying to derail the Apollo programme. It could be the Soviets I\n",
+      "suppose. At first, I thought that their willingness to shift the LUNA-FIFTEEN orbit showed that they\n",
+      "weren’t part of it, but someone in the State Department pointed out that they might just have had a\n",
+      "guilty conscience, or been keen to distance themselves once the plot was discovered. I am still not\n",
+      "sure. In the meantime, could you take a look at the computer files to see who might have had access\n",
+      "to both memos, and who might have had the opportunity and means to doctor them? I am flying back to\n",
+      "Langley tonight, to see if the State Department have any ideas what might be going on. Neil said he\n",
+      "could fly me up in one of the NASA chase planes, which is something I have been keen to try. I will\n",
+      "call you if I get anything.\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "2592"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(m_a, s_a, o_a), score_a = affine_break(ca)\n",
+    "print(m_a, s_a, o_a, '\\n')\n",
+    "print(lcat(tpack(affine_decipher(ca, m_a, s_a, o_a).split())))\n",
+    "open('2a.plaintext', 'w').write(lcat(tpack(affine_decipher(ca, m_a, s_a, o_a).split())))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3 8 True \n",
+      "\n",
+      "Apollo Ten\n",
+      "Spacecraft Operational Trajectory\n",
+      "First Revision\n",
+      "This document contains updated information about the planned lunar orbital operations for the mission and has been compiled to satisfy flight crew/flight controller training and simulation requirements.\n",
+      "\n",
+      "The following mission phases remain UNCHANGED from the original plan:\n",
+      "Launch, which ends with insertion into earth parking orbit (EPO).\n",
+      "Earth orbit coast, which ends with Translunar Injection (TLI).\n",
+      "Trans Lunar coast, which ends with Lunar Orbit Insertion (LOI).\n",
+      "Trans Earth coast, which ends with re-entry into the mid-Pacific recovery area.\n",
+      "\n",
+      "The total mission duration will be approximately EIGHT days.\n",
+      "\n",
+      "The report includes significant changes to Lunar orbital operations, which start at LOI and end with Trans Earth lnjection. NOTE THESE IMPORTANT TRAJECTORY CHANGES\n",
+      "\n",
+      "The prime objective of the LOI-TEI phase will be to demonstrate all\n",
+      "components of Mission G except those which directly involve Lunar Module powered descent and powered ascent.\n",
+      "\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "1012"
+      ]
+     },
+     "execution_count": 29,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(m_b, s_b, o_b), score_a = affine_break(cb)\n",
+    "print(m_b, s_b, o_b, '\\n')\n",
+    "print(affine_decipher(cb, m_b, s_b, o_b))\n",
+    "open('2b.plaintext', 'w').write(affine_decipher(cb, m_b, s_b, o_b))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/2019/2019-challenge3.ipynb b/2019/2019-challenge3.ipynb
new file mode 100644 (file)
index 0000000..7c3e75e
--- /dev/null
@@ -0,0 +1,419 @@
+{
+ "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": 59,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from cipher.caesar import *\n",
+    "from cipher.affine import *\n",
+    "from cipher.keyword_cipher import *\n",
+    "from support.text_prettify import *\n",
+    "from support.utilities import *\n",
+    "from support.plot_frequency_histogram import *"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "ca = open('3a.ciphertext').read()\n",
+    "cb = open('3b.ciphertext').read()\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": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "9 25 True \n",
+      "\n",
+      "Thaay, W phogen gr fe keaghwo gte irdg Huriir Geo aeurag aehiiy phdo’g ho hkkwneog dr W hdcen\n",
+      "haktwmed gr dehakt gte lwddwro uhuead wo khde gte rawqwohi aeurag thn feeo lwdswien. Gtey dehakten\n",
+      "emeaygtwoq hon krjino’g swon wg fjg gteo drleroe thn h fahwophme hon ktekcen gte Huriir eiemeo\n",
+      "swied. Gr emeayroe’d aeiwes gtey srjon wg gteae hon gte haktwmwdg aekcroen gthg drleroe qrg\n",
+      "nwdgahkgen. Pwgt gte mrijle rs lwddwro uhuead gtey hae thoniwoq gtwd wd org h djauawde, fjg qwmeo\n",
+      "gte wluraghoke rs gtede nrkjleogd wg wd h fwg hihalwoq hon nredo’g seei iwce gte phy OHDH jdjhiiy\n",
+      "nred gtwoqd. Hoyphy, gte swon dtrjin thme aehddjaen le, hon wg prjin thme ws W thno’g irrcen dr\n",
+      "khaesjiiy hg gte swie. Emeaygtwoq irrcen swoe evkeug gthg gte pran Wozekgwro wo gte ueojigwlhge\n",
+      "uhahqahut phd dueig pwgt ho W. Yrj lhy org fe djauawden, fjg ws yrj irrc hg gte nekayug rs gte\n",
+      "lhoqien meadwro wg wd lwddueig iozekgwro, pwgt ho i aeuihkwoq gte W. W prjino’g thme orgwken fjg W\n",
+      "thn nekayugen gte rawqwohi fy thon hon phd djauawden fy gte gyur. Wg dgjkc wo ly lwon dr pteo W dhp\n",
+      "gte swien meadwro pwgtrjg wg gthg ahoq hihal feiid. Roke pe dghagen womedgwqhgwoq pe irkcen ju gte\n",
+      "krlujgea swied dr W kho roiy hddjle gthg gte swien meadwro phd gahodkawfen fy drleroe ptr orp thd\n",
+      "hkkedd gr gte uawogen meadwro fjg ptr nredo’g thme gte kiehahoke gr hkkedd gte rawqwohi. Gte\n",
+      "xjedgwro wd, pty prjin gtey uarnjke h oep meadwro? W kho roiy gtwoc gthg gtey phogen gr tehn rss\n",
+      "lrae womedgwqhgwro fy qwmwoq jd h aehdro gr gtwoc wg phd hii h lwdghce hsgea hii. Ws gthg phd gte\n",
+      "uiho gteo wg thdo’g pracen. Wg deeld kieha gr le gthg drleroe aehiiy nred thme drlegtwoq gr twne. W\n",
+      "ktekcen gte dekjawgy kiehahoke iwdg hon gteae peae gpr tjonaen hon gtwagy-demeo ueruie pwgt hkkedd\n",
+      "gr gte haktwme arrl pteae pe hae dgrawoq gte womedgwqhgwro swied ptr nr org hidr thme kjaaeog hkkedd\n",
+      "gr gtrde krlujgea swied. Rs gtrde, roe tjonaen hon ewqtgeeo nwn thme gealwohi hkkedd fesrae pe\n",
+      "kirden wg nrpo, dr gte djduekg iwdg wd dtawocwoq, ptwkt W djuurde wd drlegtwoq, fjg W prjin uaesea\n",
+      "gr ohaarp wg nrpo h fwg lrae. Pwgt gte ihjokt rs Huriir Gpeime krlwoq ju oevg lrogt gte lrrn wd\n",
+      "qeggwoq geode hon W prjin aehiiy iwce gr lhce djae rja lwdktwes lhcea nredo’g thme hoy lrae\n",
+      "djauawded wo dgrae. Gr lhce lhggead prade W tehan gthg gte thpcd hg gte Ueoghqro hae qeggwoq\n",
+      "aedgiedd. Krjin yrj qeg rmea gteae hon swon rjg pthg gtey hae gtwocwoq? Qwmeo gthg rja graleogra\n",
+      "deeld gr thme uaeggy twqt-iemei hkkedd, lhyfe yrj krjin kahoc ju gte dekjawgy ro rja krlld? Lhyfe h\n",
+      "ceypran kwutea firkcen hd dghonhan? Leq\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "2558"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(m_a, s_a, o_a), score_a = affine_break(ca)\n",
+    "print(m_a, s_a, o_a, '\\n')\n",
+    "print(lcat(tpack(affine_decipher(ca, m_a, s_a, o_a).split())))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('saturn', <KeywordWrapAlphabet.from_largest: 3>, -2573.856474269662)"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(key_a, wrap_a), score_a = keyword_break_mp(ca)\n",
+    "key_a, wrap_a, score_a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "harry, i wanted to be certain the lost apollo ten report really wasn’t an accident so i asked\n",
+      "archives to search the mission papers in case the original report had been misfiled. they searched\n",
+      "everything and couldn’t find it but then someone had a brainwave and checked the apollo eleven\n",
+      "files. to everyone’s relief they found it there and the archivist reckoned that someone got\n",
+      "distracted. with the volume of mission papers they are handling this is not a surprise, but given\n",
+      "the importance of these documents it is a bit alarming and doesn’t feel like the way nasa usually\n",
+      "does things. anyway, the find should have reassured me, and it would have if i hadn’t looked so\n",
+      "carefully at the file. everything looked fine except that the word injection in the penultimate\n",
+      "paragraph was spelt with an i. you may not be surprised, but if you look at the decrypt of the\n",
+      "mangled version it is misspelt lnjection, with an l replacing the i. i wouldn’t have noticed but i\n",
+      "had decrypted the original by hand and was surprised by the typo. it stuck in my mind so when i saw\n",
+      "the filed version without it that rang alarm bells. once we started investigating we locked up the\n",
+      "computer files so i can only assume that the filed version was transcribed by someone who now has\n",
+      "access to the printed version but who doesn’t have the clearance to access the original. the\n",
+      "question is, why would they produce a new version? i can only think that they wanted to head off\n",
+      "more investigation by giving us a reason to think it was all a mistake after all. if that was the\n",
+      "plan then it hasn’t worked. it seems clear to me that someone really does have something to hide. i\n",
+      "checked the security clearance list and there were two hundred and thirty-seven people with access\n",
+      "to the archive room where we are storing the investigation files who do not also have current access\n",
+      "to those computer files. of those, one hundred and eighteen did have terminal access before we\n",
+      "closed it down, so the suspect list is shrinking, which i suppose is something, but i would prefer\n",
+      "to narrow it down a bit more. with the launch of apollo twelve coming up next month the mood is\n",
+      "getting tense and i would really like to make sure our mischief maker doesn’t have any more\n",
+      "surprises in store. to make matters worse i heard that the hawks at the pentagon are getting\n",
+      "restless. could you get over there and find out what they are thinking? given that our tormentor\n",
+      "seems to have pretty high-level access, maybe you could crank up the security on our comms? maybe a\n",
+      "keyword cipher blocked as standard? meg\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(lcat(tpack(keyword_decipher(ca, key_a, wrap_a).split())))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Harry,\n",
+      "\n",
+      "I wanted to be certain the lost Apollo Ten report really wasn’t an accident so I asked archives to search the mission papers in case the original report had been misfiled. They searched everything and couldn’t find it but then someone had a brainwave and checked the Apollo eleven files. To everyone’s relief they found it there and the archivist reckoned that someone got distracted. With the volume of mission papers they are handling this is not a surprise, but given the importance of these documents it is a bit alarming and doesn’t feel like the way NASA usually does things. Anyway, the find should have reassured me, and it would have if I hadn’t looked so carefully at the file. Everything looked fine except that the word Injection in the penultimate paragraph was spelt with an I. You may not be surprised, but if you look at the decrypt of the mangled version it is misspelt lnjection, with an l replacing the I.\n",
+      "\n",
+      "I wouldn’t have noticed but I had decrypted the original by hand and was surprised by the typo. It stuck in my mind so when I saw the filed version without it that rang alarm bells. Once we started investigating we locked up the computer files so I can only assume that the filed version was transcribed by someone who now has access to the printed version but who doesn’t have the clearance to access the original. The question is, why would they produce a new version? I can only think that they wanted to head off more investigation by giving us a reason to think it was all a mistake after all. If that was the plan then it hasn’t worked. It seems clear to me that someone really does have something to hide.\n",
+      "\n",
+      "I checked the security clearance list and there were two hundred and thirty-seven people with access to the archive room where we are storing the investigation files who do not also have current access to those computer files. Of those, one hundred and eighteen did have terminal access before we closed it down, so the suspect list is shrinking, which I suppose is something, but I would prefer to narrow it down a bit more. With the launch of Apollo Twelve coming up next month the mood is getting tense and I would really like to make sure our mischief maker doesn’t have any more surprises in store.\n",
+      "\n",
+      "To make matters worse I heard that the hawks at the Pentagon are getting restless. Could you get over there and find out what they are thinking? Given that our tormentor seems to have pretty high-level access, maybe you could crank up the security on our comms? Maybe a keyword cipher blocked as standard?\n",
+      "\n",
+      "Meg\n",
+      "\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "2564"
+      ]
+     },
+     "execution_count": 21,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "print(repunctuate(keyword_decipher(ca, key_a, wrap_a), pta))\n",
+    "open('3a.plaintext', 'w').write(repunctuate(keyword_decipher(ca, key_a, wrap_a), pta))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('stunk', <KeywordWrapAlphabet.from_last: 2>, -2377.4918717301703)"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(key_b, wrap_b), score_b = keyword_break_mp(scb)\n",
+    "key_b, wrap_b, score_b"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "MEGIS PENTL AOUPC EOFBL YSOVE RLTTD EPENT LGONH RIEFI NGTDE STLFF LNBTR YINGT OGLUG ETDEM OOBTD EREYO ULRER IGDTT DEDLW KSLRE GETTI NGPRE TTYRE STCES SLNBD LVEMO REORC ESSBE AIBEB LCREL BYTDL TTDES OVIET SLRET OHCLM EFORR EAENT EVENT SONTD ELPOC COPRO GRLMM ESOME OFTDE GENER LCSBO NTNEE BMUAD OFLNE XAUSE TOTUR NUPTD EDELT HUTYO UBONT GETFO URSTL RSWIT DOUTU NBERS TLNBI NGTDE NEEBF ORPOC ITIAL CSUPP ORTLN BTDER EDLSH EENLA ONAER TEBWD ISPER INGAL MPLIG NTOAO NVINA ETDEP RESIB ENTTO TLKEL STRON GCINE TDEMO STSTR IBENT LREAL CCING FORLC LRGEH UICBU POFFO RAESL CONGT DEHOR BERWI TDELS TGERM LNYLS LSDOW OFSTR ENGTD LRGUI NGTDL TTDEL TTLAK ONTDE SPLAE PROGR LMMEM USTDL VEHEE NLUTD ORISE BHYTD EPOCI THURO TDLTM LKESN OSENS ETOME FIRST TDERU SSILN SLREM ORECI KECYT OTRYT OWINT DEPRO PLGLN BLWLR TDLNT ORISK AONFC IATLN BSEAO NBTDE SLHOT LGEIF TDLTI SWDLT ITISI SNTSO PDIST IALTE BENOU GDFOR LKGHO PERLT IONHU TITIS DLRBT OAONV INAET DEGEN ERLCS TDLTT DLTIS TRUES OMEOF TDEMO REALU TIOUS PCLNN ERSMO STCYT DOSEW DOLAT ULCCY FOUGD TINTD ECLST WLRDL VEMLN LGEBT OHCOA KTDEH UICBU PPROP OSING LNEWT RLNAD EOFWL RGLME SINST ELBMO HICIS INGTD LTWLY ISSTI CCLPR OVOAL TIONH UTISC ESSCI KECYT OLAAI BENTL CCYTR IGGER LWLRE SPEAI LCCYI FWENO TIFYP LVCOV SKYIN LBVLN AELCC TDESL MEMYO WNTIM EINHE RCINA ONVIN AEBME WEDLV ETOTR ELBVE RYSOF TCYTD ERESO IDELB EBOVE RTOCL NGCEY LNBAO NVINA EBTDE MTOSU GGEST LNLCT ERNLT IVEWE WICCS TEPUP INSPE ATION SLTAD EAKPO INTAD LRCIE TOMLK EITDL RBERF ORSOV IETLG ENTST OAROS SLNBA RLNKU PTDET EUFEC SHERG CISTE NINGO PERLT IONTO SEEIF TDLTT URNSU PLNYT DINGR ECLTE BILML CSOGO INGTO SENBL AOUPC EOFOU RHEST OVERT OHLIK ONURT OTRYL NBFIN BOUTW DLTIS GOING ONTDE RETDE SOVIE TSLRE PRETT YSEAR ETIVE LHOUT TDEIR OWNSP LAEPR OGRLM MELNB WITDO UTTDE WORCB SPRES SWLTA DINGW EBONT RELCC YDLVE LACEL RPIAT UREOF TDEIR PROGR ESSOR TDEIR PCLNS UNCES STDEY LREAC OSETO PUTTI NGTDE IROWN MENON TDEMO ONIAL NTSEE WDLTT DEYDL VETOG LINWI TDWDL TSEEM STOHE LFLIR CYBIS ORGLN ISEBL TTEMP TTOBE RLICO URSPL AEPRO GRLMM EHUTI WOUCB STICC CIKET OKNOW WDLTT DEYLR EUPTO KEEPL ACOSE EYEON TDEMI SSION PCLNN INGLN BCETM EKNOW IFYOU DELRL NYTDI NGWOR RYING IWICC HEHLA KLHOU TLWEE KHEFO RETDE CLUNA DDLRR Y\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(repunctuate(keyword_decipher(scb, key_b, wrap_b), ptb))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "1 10 True \n",
+      "\n",
+      "MACFS PANTL IOUPK AOBJL YSOVA RLTTD APANT LCONE RFABF NCTDA STLBB LNJTR YFNCT OCLUC ATDAM OOJTD ARAYO ULRAR FCDTT DADLW HSLRA CATTF NCPRA TTYRA STKAS SLNJD LVAMO RAORK ASSJA IFJAJ LKRAL JYTDL TTDAS OVFAT SLRAT OEKLM ABORR AIANT AVANT SONTD ALPOK KOPRO CRLMM ASOMA OBTDA CANAR LKSJO NTNAA JMUID OBLNA XIUSA TOTUR NUPTD ADALT EUTYO UJONT CATBO URSTL RSWFT DOUTU NJARS TLNJF NCTDA NAAJB ORPOK FTFIL KSUPP ORTLN JTDAR ADLSE AANLI ONIAR TAJWD FSPAR FNCIL MPLFC NTOIO NVFNI ATDAP RASFJ ANTTO TLHAL STRON CKFNA TDAMO STSTR FJANT LRAIL KKFNC BORLK LRCAE UFKJU POBBO RIASL KONCT DAEOR JARWF TDALS TCARM LNYLS LSDOW OBSTR ANCTD LRCUF NCTDL TTDAL TTLIH ONTDA SPLIA PROCR LMMAM USTDL VAEAA NLUTD ORFSA JEYTD APOKF TEURO TDLTM LHASN OSANS ATOMA BFRST TDARU SSFLN SLRAM ORAKF HAKYT OTRYT OWFNT DAPRO PLCLN JLWLR TDLNT ORFSH IONBK FITLN JSAIO NJTDA SLEOT LCAFB TDLTF SWDLT FTFSF SNTSO PDFST FILTA JANOU CDBOR LHCEO PARLT FONEU TFTFS DLRJT OIONV FNIAT DACAN ARLKS TDLTT DLTFS TRUAS OMAOB TDAMO RAILU TFOUS PKLNN ARSMO STKYT DOSAW DOLIT ULKKY BOUCD TFNTD AKLST WLRDL VAMLN LCAJT OEKOI HTDAE UFKJU PPROP OSFNC LNAWT RLNID AOBWL RCLMA SFNST ALJMO EFKFS FNCTD LTWLY FSSTF KKLPR OVOIL TFONE UTFSK ASSKF HAKYT OLIIF JANTL KKYTR FCCAR LWLRA SPAIF LKKYF BWANO TFBYP LVKOV SHYFN LJVLN IALKK TDASL MAMYO WNTFM AFNEA RKFNI ONVFN IAJMA WADLV ATOTR ALJVA RYSOB TKYTD ARASO FDALJ AJOVA RTOKL NCKAY LNJIO NVFNI AJTDA MTOSU CCAST LNLKT ARNLT FVAWA WFKKS TAPUP FNSPA ITFON SLTID AIHPO FNTID LRKFA TOMLH AFTDL RJARB ORSOV FATLC ANTST OIROS SLNJI RLNHU PTDAT AUBAK SEARC KFSTA NFNCO PARLT FONTO SAAFB TDLTT URNSU PLNYT DFNCR AKLTA JFLML KSOCO FNCTO SANJL IOUPK AOBOU REAST OVART OELFH ONURT OTRYL NJBFN JOUTW DLTFS COFNC ONTDA RATDA SOVFA TSLRA PRATT YSAIR ATFVA LEOUT TDAFR OWNSP LIAPR OCRLM MALNJ WFTDO UTTDA WORKJ SPRAS SWLTI DFNCW AJONT RALKK YDLVA LIKAL RPFIT URAOB TDAFR PROCR ASSOR TDAFR PKLNS UNKAS STDAY LRAIK OSATO PUTTF NCTDA FROWN MANON TDAMO ONFIL NTSAA WDLTT DAYDL VATOC LFNWF TDWDL TSAAM STOEA LBLFR KYJFS ORCLN FSAJL TTAMP TTOJA RLFKO URSPL IAPRO CRLMM AEUTF WOUKJ STFKK KFHAT OHNOW WDLTT DAYLR AUPTO HAAPL IKOSA AYAON TDAMF SSFON PKLNN FNCLN JKATM AHNOW FBYOU DALRL NYTDF NCWOR RYFNC FWFKK EAELI HLEOU TLWAA HEABO RATDA KLUNI DDLRR Y\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "(m_b, s_b, o_b), score_a = affine_break(scb)\n",
+    "print(m_b, s_b, o_b, '\\n')\n",
+    "print(affine_decipher(cb, m_b, s_b, o_b))\n",
+    "# open('3b.plaintext', 'w').write(affine_decipher(cb, m_b, s_b, o_b))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 69,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('vostklmnpqruwxyzabcdefghij',\n",
+       " 'megispentacoupleofdaysoveratthepentagonbriefingthestaffandtryingtogaugethemoodthereyouarerightthehawksaregettingprettyrestlessandhavemoreorlessdecidedalreadythatthesovietsaretoblameforrecenteventsontheapolloprogrammesomeofthegeneralsdontneedmuchofanexcusetoturnuptheheatbutyoudontgetfourstarswithoutunderstandingtheneedforpoliticalsupportandtherehasbeenaconcertedwhisperingcampaigntoconvincethepresidenttotakeastronglinethemoststridentarecallingforalargebuildupofforcesalongtheborderwitheastgermanyasashowofstrengtharguingthattheattackonthespaceprogrammemusthavebeenauthorisedbythepolitburothatmakesnosensetomefirsttherussiansaremorelikelytotrytowinthepropagandawarthantoriskconflictandsecondthesabotageifthatiswhatitisisntsophisticatedenoughforakgboperationbutitishardtoconvincethegeneralsthatthatistruesomeofthemorecautiousplannersmostlythosewhoactuallyfoughtinthelastwarhavemanagedtoblockthebuildupproposinganewtrancheofwargamesinsteadmobilisingthatwayisstillaprovocationbutislesslikelytoaccidentallytriggerawarespeciallyifwenotifypavlovskyinadvanceallthesamemyowntimeinberlinconvincedmewehavetotreadverysoftlytheresoiheadedovertolangleyandconvincedthemtosuggestanalternativewewillstepupinspectionsatcheckpointcharlietomakeitharderforsovietagentstocrossandcrankuptheteufelsberglisteningoperationtoseeifthatturnsupanythingrelatediamalsogoingtosendacoupleofourbestovertobaikonurtotryandfindoutwhatisgoingontherethesovietsareprettysecretiveabouttheirownspaceprogrammeandwithouttheworldspresswatchingwedontreallyhaveaclearpictureoftheirprogressortheirplansunlesstheyareclosetoputtingtheirownmenonthemoonicantseewhattheyhavetogainwithwhatseemstobeafairlydisorganisedattempttoderailourspaceprogrammebutiwouldstillliketoknowwhattheyareuptokeepacloseeyeonthemissionplanningandletmeknowifyouhearanythingworryingiwillbebackaboutaweekbeforethelaunchharry')"
+      ]
+     },
+     "execution_count": 69,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "key_b, score_b = simulated_annealing_break(scb, fitness=Ptrigrams)\n",
+    "key_b, keyword_decipher(scb, key_b, KeywordWrapAlphabet.from_last)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 70,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "megis penta couple of days over at the pentagon briefing the staff and trying to gauge the mood\n",
+      "there you are right the hawks are getting pretty restless and have more or less decided already that\n",
+      "the soviets are to blame for recent events on the apollo programme some of the generals dont need\n",
+      "much of an excuse to turn up the heat but you dont get four stars without understanding the need for\n",
+      "political support and there has been a concerted whispering campaign to convince the president to\n",
+      "take a strong line the most strident are calling for a large buildup of forces along the border with\n",
+      "east germany as a show of strength arguing that the attack on the space programme must have been\n",
+      "authorised by the politburo that makes no sense to me first the russians are more likely to try to\n",
+      "win the propaganda war than to risk conflict and second the sabotage if that is what it is isnt\n",
+      "sophisticated enough for a kgb operation but it is hard to convince the generals that that is true\n",
+      "some of the more cautious planners mostly those who actually fought in the last war have managed to\n",
+      "block the buildup proposing a new tranche of wargames instead mobilising that way is still a\n",
+      "provocation but is less likely to accidentally trigger aware specially if we notify pavlovsky in\n",
+      "advance all the same my own time in berlin convinced me we have to tread very softly there so i\n",
+      "headed over to langley and convinced them to suggest an alternative we will step up inspections at\n",
+      "checkpoint charlie to make it harder for soviet agents to cross and crank up the teufel s berg\n",
+      "listening operation to see if that turns up anything related i am also going to send a couple of our\n",
+      "best over to baikonur to try and find out what is going on there the soviets are pretty secretive\n",
+      "about their own space programme and without the worlds press watching we dont really have a clear\n",
+      "picture of their progress or their plans unless they are close to putting their own men on the moon\n",
+      "icant see what they have to gain with what seems to be a fairly disorganised attempt to derail our\n",
+      "space programme but i would still like to know what they are up to keep a close eye on the mission\n",
+      "planning and let me know if you hear anything worrying i will be back about a week before the launch\n",
+      "harry\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(lcat(tpack(segment(keyword_decipher(scb, key_b, KeywordWrapAlphabet.from_last)))))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 72,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "megis penta couple of days over at the pentagon briefing the staff and trying to gauge the mood\n",
+      "there you are right the hawks are getting pretty restless and have more or less decided already that\n",
+      "the soviets are to blame for recent events on the apollo programme some of the generals dont need\n",
+      "much of an excuse to turn up the heat but you dont get four stars without understanding the need for\n",
+      "political support and there has been a concerted whispering campaign to convince the president to\n",
+      "take a strong line the most strident are calling for a large buildup of forces along the border with\n",
+      "east germany as a show of strength arguing that the attack on the space programme must have been\n",
+      "authorised by the politburo that makes no sense to me first the russians are more likely to try to\n",
+      "win the propaganda war than to risk conflict and second the sabotage if that is what it is isnt\n",
+      "sophisticated enough for a kgb operation but it is hard to convince the generals that that is true\n",
+      "some of the more cautious planners mostly those who actually fought in the last war have managed to\n",
+      "block the buildup proposing a new tranche of wargames instead mobilising that way is still a\n",
+      "provocation but is less likely to accidentally trigger aware specially if we notify pavlovsky in\n",
+      "advance all the same my own time in berlin convinced me we have to tread very softly there so i\n",
+      "headed over to langley and convinced them to suggest an alternative we will step up inspections at\n",
+      "checkpoint charlie to make it harder for soviet agents to cross and crank up the teufel s berg\n",
+      "listening operation to see if that turns up anything related i am also going to send a couple of our\n",
+      "best over to baikonur to try and find out what is going on there the soviets are pretty secretive\n",
+      "about their own space programme and without the worlds press watching we dont really have a clear\n",
+      "picture of their progress or their plans unless they are close to putting their own men on the moon\n",
+      "icant see what they have to gain with what seems to be a fairly disorganised attempt to derail our\n",
+      "space programme but i would still like to know what they are up to keep a close eye on the mission\n",
+      "planning and let me know if you hear anything worrying i will be back about a week before the launch\n",
+      "harry\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(lcat(tpack(segment(keyword_decipher(scb, 'vostok', KeywordWrapAlphabet.from_last)))))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 73,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2267"
+      ]
+     },
+     "execution_count": 73,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "open('3b.plaintext', 'w').write(lcat(tpack(segment(keyword_decipher(scb, 'vostok', KeywordWrapAlphabet.from_last)))))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/2019/2019-challenge4.ipynb b/2019/2019-challenge4.ipynb
new file mode 100644 (file)
index 0000000..fe5afb2
--- /dev/null
@@ -0,0 +1,376 @@
+{
+ "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": 16,
+   "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 support.text_prettify import *\n",
+    "from support.utilities import *\n",
+    "from support.plot_frequency_histogram import *"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "challenge_number = 4\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": 22,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "ca = open(ciphertext_a_filename).read()\n",
+    "cb = open(ciphertext_b_filename).read()\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": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "15 21 True \n",
+      "\n",
+      "WES, N GOHE ZEED VKFBNDS TGFKASG TGE INMT KL MAMRNCNKAM NDCNPEDTM OLLECTNDS ORKIIK EIEHED ODP NT NM\n",
+      "IKDSEF TGOD QKA WNSGT TGNDB. TGE RFE-IOADCG, MTOSE TGFEE TGFAMTEF HOIHE RFKZIEW NM O INTTIE\n",
+      "MAMRNCNKAM SNHED OII TGE CGECBM TGOT TKKB RIOCE ZELKFE TGOT, ZAT KD TGE KTGEF GODP TEIEWETFQ\n",
+      "SAOFODTEEP TGOT NT VKAIP ZE PETECTEP ODP TGE TECGDNCNODM MGKVEP TGOT NT VOM EOMQ TK ZQROMM. NL TGOT\n",
+      "VOM O MOZKTOSE OTTEWRT TGED NT VOMD'T HEFQ VEII PEMNSDEP, MK N PKD'T TGNDB NT CKAIP GOHE ZEED OD\n",
+      "EDSNDEEF TGOT MET NT AR. KD TGE KTGEF GODP, DK-KDE EIME VKAIP GOHE GOP TNWE OIKDE VNTG TGE\n",
+      "CKWRKDEDT. KD TGE KTGEF GODP, MKWEKDE LFKW LNPK'M TEOW MEDT WE O WEMMOSE TK TEII WE OZKAT O HEFQ\n",
+      "DEOF WNMM TGOT MKADPM INBE NT CKAIP GOHE ZEED O MEFNKAM OTTEWRT TK PEMTFKQ TGE CKWWODP WKPAIE KD\n",
+      "FE-EDTFQ. OM ORKIIK JN ORRFKOCGEP TGE FE-EDTFQ RKNDT TGEQ UETTNMKDEP TGE MEFHNCE WKPAIE TK FE-KFNEDT\n",
+      "TGE CKWWODP WKPAIE MK TGOT TGE GEOTMGNEIP VOM RKNDTNDS NDTK TGE OTWKMRGEFE. MNDCE TGEQ VEFE KD\n",
+      "RFETTQ WACG O ZOIINMTNC KFZNT TGE MW VKAIP GOHE MTOQEP CIKME TK TGE CW, ODP VNTGKAT O GEOTMGNEIP KL\n",
+      "NTM KVD NT VKAIP ZFEOB AR NDTK IOFSE RNECEM TGOT RKMEP O MNSDNLNCODT PODSEF TK TGE CW ODP NTM CFEV.\n",
+      "TK OHKNP TGOT TGE MW VOM MARRKMEP TK COFFQ KAT O MEYAEDCE KL MGKFT ZAFDM TK WKHE NTM TFOUECTKFQ OVOQ\n",
+      "LFKW TGE CKWWODP WKPAIE, MBNRRNDS NT KLL TGE OTWKMRGEFE MK TGOT TGE CW CKAIP FE-EDTEF LFEE LFKW TGE\n",
+      "PEZFNM LNEIP. ADLKFTADOTEIQ, TGOT PKEMD'T MEEW TK GOHE GORREDEP. OIPFND FERKFTEP TGOT TGE CW LIEV\n",
+      "ROMT TGE MW VGNCG VOM LIQNDS OT OD OTTOCB ODSIE VEII ZEQKDP KREFOTNKDOI ROFOWETEFM, ODP O CKWWEFCNOI\n",
+      "RNIKT, LFODB ZFKVD, FERKFTEP MEENDS TGE TVK MROCECFOLT TFOCBNDS CIKMEIQ OM TGEQ ZAFDEP TGFKASG TGE\n",
+      "OTWKMRGEFE. O MNDSIE CKIINMNKD VNTG KDE KL TGE VGNTE-GKT LFOSWEDTM CKAIP GOHE ZOPIQ POWOSEP TGE\n",
+      "FE-EDTFQ CORMAIE, ODP EHED NL TGE OMTFKDOATM GOP MAFHNHEP TGE CKIINMNKD TGED TGE KPPM OFE TGOT TGE\n",
+      "ROFOCGATE MQMTEW VKAIP GOHE TFNSSEFEP EOFIQ KF ZEED LOTOIIQ POWOSEP ZQ TGE ZIOMT. DOMO EDSNDEEFM OFE\n",
+      "VKFBNDS LOMT TK CKFFECT TGE RFKZIEW LKF ORKIIK JNNN ODP TGEQ GOHE WNTNSOTNKDM ND RIOCE LKF JNN'M\n",
+      "FE-EDTFQ, ZAT TGE HNEV KL TGE EJREFTM NM TGOT TGEQ PKPSEP O ZAIIET VNTG TGNM. TGE LINSGT KLLNCEF VGK\n",
+      "FERKFTEP NT TK WE RKNDTEP KAT TGOT NL TGE MKHNETM VODTEP TK MOZKTOSE TGE WNMMNKD TGNM WNSGT GOHE\n",
+      "ZEED O SKKP ZET: NT VOM O DOMTQ OCCNPEDT TGOT VOM GOFP TK LKFEMEE, ODP NT VNII ZE HEFQ PNLLNCAIT TK\n",
+      "MGKV TGOT MKWEKDE PEINZEFOTEIQ WNMCOICAIOTEP TGE ZAFD TNWEM MNDCE NT VOM TGE NDTEFOCTNKD KL TGE\n",
+      "TGFAMTEFM ODP MTOZNINMEFM TGOT COAMEP TGE RFKZIEW. N TGNDB GE NM KDE KL O SFKVNDS DAWZEF KL DOMO\n",
+      "EWRIKQEEM VGK GOHE ZESAD TK ZEINEHE TGOT TGE AMMF GOM PEER CKHEF OSEDTM VKFBNDS TK PEMTOZNINME TGE\n",
+      "RFKSFOWWE. WQ VKFFQ NM TGOT EHED NL GE NM VFKDS, TGE IOCB KL TFAMT TGOT NM SFKVNDS VNTGND TGE\n",
+      "KFSODNMOTNKD VNII PEMTOZNINME NT KD NTM KVD. N OW FEOIIQ GKRNDS GE NM WNMTOBED. TGE MACCEMM KL\n",
+      "ORKIIK JN MEEWM TK GOHE ZKASGT O IKT KL NDTEFDOTNKDOI SKKPVNII ODP N TGNDB NT CKAIP ZE TGE MTOFT KL\n",
+      "MKWETGNDS WKFE RKMNTNHE. TGE MKHNET CKKREFOTNKD VNTG TGE IODPNDS SOHE WE GKRE TGOT VE CKAIP LNDP\n",
+      "WKFE CKWWKD SFKADP ODP MTOFT TK TGOV EOMT-VEMT FEIOTNKDM, ZAT TGNM CKAIP FEOIIQ TGFEOTED TGOT. ND\n",
+      "TGE WEOD-TNWE VE GOP ZETTEF MTER AR MECAFNTQ. N TGNDB VE MGKAIP AME O MNWRIE HNSEDEFE CNRGEF VNTG\n",
+      "REFNKP TVK LKF KAF DEJT WEMMOSE. N GOHE EDCFQRTEP TGE OTTOCGEP FE-EDTFQ FERKFT AMNDS O CKIAWDOF\n",
+      "TFODMRKMNTNKD CNRGEF\n"
+     ]
+    }
+   ],
+   "source": [
+    "(m_a, s_a, o_a), score_a = affine_break(ca)\n",
+    "print(m_a, s_a, o_a, '\\n')\n",
+    "print(lcat(tpack(affine_decipher(ca, m_a, s_a, o_a).split())))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('lunar', <KeywordWrapAlphabet.from_last: 2>, -3366.553587533618)"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(key_a, wrap_a), score_a = keyword_break_mp(ca)\n",
+    "key_a, wrap_a, score_a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "meg, i have been working through the list of suspicious incidents affecting apollo eleven and it is\n",
+      "longer than you might think. the pre-launch, stage three thruster valve problem is a little\n",
+      "suspicious given all the checks that took place before that, but on the other hand telemetry\n",
+      "guaranteed that it would be detected and the technicians showed that it was easy to bypass. if that\n",
+      "was a sabotage attempt then it wasn't very well designed, so i don't think it could have been an\n",
+      "engineer that set it up. on the other hand, no-one else would have had time alone with the\n",
+      "component. on the other hand, someone from fido's team sent me a message to tell me about a very\n",
+      "near miss that sounds like it could have been a serious attempt to destroy the command module on\n",
+      "re-entry. as apollo xi approached the re-entry point they jettisoned the service module to re-orient\n",
+      "the command module so that the heatshield was pointing into the atmosphere. since they were on\n",
+      "pretty much a ballistic orbit the sm would have stayed close to the cm, and without a heatshield of\n",
+      "its own it would break up into large pieces that posed a significant danger to the cm and its crew.\n",
+      "to avoid that the sm was supposed to carry out a sequence of short burns to move its trajectory away\n",
+      "from the command module, skipping it off the atmosphere so that the cm could re-enter free from the\n",
+      "debris field. unfortunately, that doesn't seem to have happened. aldrin reported that the cm flew\n",
+      "past the sm which was flying at an attack angle well beyond operational parameters, and a commercial\n",
+      "pilot, frank brown, reported seeing the two spacecraft tracking closely as they burned through the\n",
+      "atmosphere. a single collision with one of the white-hot fragments could have badly damaged the\n",
+      "re-entry capsule, and even if the astronauts had survived the collision then the odds are that the\n",
+      "parachute system would have triggered early or been fatally damaged by the blast. nasa engineers are\n",
+      "working fast to correct the problem for apollo xiii and they have mitigations in place for xii's\n",
+      "re-entry, but the view of the experts is that they dodged a bullet with this. the flight officer who\n",
+      "reported it to me pointed out that if the soviets wanted to sabotage the mission this might have\n",
+      "been a good bet: it was a nasty accident that was hard to foresee, and it will be very difficult to\n",
+      "show that someone deliberately miscalculated the burn times since it was the interaction of the\n",
+      "thrusters and stabilisers that caused the problem. i think he is one of a growing number of nasa\n",
+      "employees who have begun to believe that the ussr has deep cover agents working to destabilise the\n",
+      "programme. my worry is that even if he is wrong, the lack of trust that is growing within the\n",
+      "organisation will destabilise it on its own. i am really hoping he is mistaken. the success of\n",
+      "apollo xi seems to have bought a lot of international goodwill and i think it could be the start of\n",
+      "something more positive. the soviet cooperation with the landing gave me hope that we could find\n",
+      "more common ground and start to thaw east-west relations, but this could really threaten that. in\n",
+      "the mean-time we had better step up security. i think we should use a simple vigenere cipher with\n",
+      "period two for our next message. i have encrypted the attached re-entry report using a columnar\n",
+      "transposition cipher\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(lcat(tpack(keyword_decipher(ca, key_a, wrap_a).split())))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "MEG,\n",
+      "I HAVE BEEN WORKING THROUGH THE LIST OF SUSPICIOUS INCIDENTS AFFECTING APOLLO ELEVEN AND IT IS LONGER THAN YOU MIGHT THINK. THE PRE-LAUNCH, STAGE THREE THRUSTER VALVE PROBLEM IS A LITTLE SUSPICIOUS GIVEN ALL THE CHECKS THAT TOOK PLACE BEFORE THAT, BUT ON THE OTHER HAND TELEMETRY GUARANTEED THAT IT WOULD BE DETECTED AND THE TECHNICIANS SHOWED THAT IT WAS EASY TO BYPASS. IF THAT WAS A SABOTAGE ATTEMPT THEN IT WASN'T VERY WELL DESIGNED, SO I DON'T THINK IT COULD HAVE BEEN AN ENGINEER THAT SET IT UP. ON THE OTHER HAND, NO-ONE ELSE WOULD HAVE HAD TIME ALONE WITH THE COMPONENT. ON THE OTHER HAND, SOMEONE FROM FIDO'S TEAM SENT ME A MESSAGE TO TELL ME ABOUT A VERY NEAR MISS THAT SOUNDS LIKE IT COULD HAVE BEEN A SERIOUS ATTEMPT TO DESTROY THE COMMAND MODULE ON RE-ENTRY.\n",
+      "AS APOLLO XI APPROACHED THE RE-ENTRY POINT THEY JETTISONED THE SERVICE MODULE TO RE-ORIENT THE COMMAND MODULE SO THAT THE HEATSHIELD WAS POINTING INTO THE ATMOSPHERE. SINCE THEY WERE ON PRETTY MUCH A BALLISTIC ORBIT THE SM WOULD HAVE STAYED CLOSE TO THE CM, AND WITHOUT A HEATSHIELD OF ITS OWN IT WOULD BREAK UP INTO LARGE PIECES THAT POSED A SIGNIFICANT DANGER TO THE CM AND ITS CREW. TO AVOID THAT THE SM WAS SUPPOSED TO CARRY OUT A SEQUENCE OF SHORT BURNS TO MOVE ITS TRAJECTORY AWAY FROM THE COMMAND MODULE, SKIPPING IT OFF THE ATMOSPHERE SO THAT THE CM COULD RE-ENTER FREE FROM THE DEBRIS FIELD. UNFORTUNATELY, THAT DOESN'T SEEM TO HAVE HAPPENED. ALDRIN REPORTED THAT THE CM FLEW PAST THE SM WHICH WAS FLYING AT AN ATTACK ANGLE WELL BEYOND OPERATIONAL PARAMETERS, AND A COMMERCIAL PILOT, FRANK BROWN, REPORTED SEEING THE TWO SPACECRAFT TRACKING CLOSELY AS THEY BURNED THROUGH THE ATMOSPHERE. A SINGLE COLLISION WITH ONE OF THE WHITE-HOT FRAGMENTS COULD HAVE BADLY DAMAGED THE RE-ENTRY CAPSULE, AND EVEN IF THE ASTRONAUTS HAD SURVIVED THE COLLISION THEN THE ODDS ARE THAT THE PARACHUTE SYSTEM WOULD HAVE TRIGGERED EARLY OR BEEN FATALLY DAMAGED BY THE BLAST. NASA ENGINEERS ARE WORKING FAST TO CORRECT THE PROBLEM FOR APOLLO XIII AND THEY HAVE MITIGATIONS IN PLACE FOR XII'S RE-ENTRY, BUT THE VIEW OF THE EXPERTS IS THAT THEY DODGED A BULLET WITH THIS. THE FLIGHT OFFICER WHO REPORTED IT TO ME POINTED OUT THAT IF THE SOVIETS WANTED TO SABOTAGE THE MISSION THIS MIGHT HAVE BEEN A GOOD BET: IT WAS A NASTY ACCIDENT THAT WAS HARD TO FORESEE, AND IT WILL BE VERY DIFFICULT TO SHOW THAT SOMEONE DELIBERATELY MISCALCULATED THE BURN TIMES SINCE IT WAS THE INTERACTION OF THE THRUSTERS AND STABILISERS THAT CAUSED THE PROBLEM. I THINK HE IS ONE OF A GROWING NUMBER OF NASA EMPLOYEES WHO HAVE BEGUN TO BELIEVE THAT THE USSR HAS DEEP COVER AGENTS WORKING TO DESTABILISE THE PROGRAMME. MY WORRY IS THAT EVEN IF HE IS WRONG, THE LACK OF TRUST THAT IS GROWING WITHIN THE ORGANISATION WILL DESTABILISE IT ON ITS OWN. I AM REALLY HOPING HE IS MISTAKEN. THE SUCCESS OF APOLLO XI SEEMS TO HAVE BOUGHT A LOT OF INTERNATIONAL GOODWILL AND I THINK IT COULD BE THE START OF SOMETHING MORE POSITIVE. THE SOVIET COOPERATION WITH THE LANDING GAVE ME HOPE THAT WE COULD FIND MORE COMMON GROUND AND START TO THAW EAST-WEST RELATIONS, BUT THIS COULD REALLY THREATEN THAT.\n",
+      "IN THE MEAN-TIME WE HAD BETTER STEP UP SECURITY. I THINK WE SHOULD USE A SIMPLE VIGENERE CIPHER WITH PERIOD TWO FOR OUR NEXT MESSAGE. I HAVE ENCRYPTED THE ATTACHED RE-ENTRY REPORT USING A COLUMNAR TRANSPOSITION CIPHER\n",
+      "\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "3344"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "print(repunctuate(keyword_decipher(ca, key_a, wrap_a), pta))\n",
+    "open(plaintext_a_filename, 'w').write(repunctuate(keyword_decipher(ca, key_a, wrap_a), pta))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(((2, 4, 3, 1, 0, 6, 5), False, True), -7729.531557000563)"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(key_b, fillcolumnwise_b, emptycolumnwise_b), score_b = column_transposition_break_mp(scb, fitness=Ptrigrams)\n",
+    "(key_b, fillcolumnwise_b, emptycolumnwise_b), score_b"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(((6, 5, 4, 3, 2, 1, 0), False, False), -8768.791674998944)"
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# (key_b, fillcolumnwise_b, emptycolumnwise_b), score_b = column_transposition_break_mp(scb, fitness=Pbigrams)\n",
+    "# (key_b, fillcolumnwise_b, emptycolumnwise_b), score_b"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'apolloxipostflightanalysisspacecraftreentrytrajectoryreviewthisdocumentcontainsinformationabouttheeventsduringthereentryphaseofapolloxiithasbeencompiledtosatisfyflightplanningsafetyrequirementsthereviewcoversthefollowingmissionphasetransearthcoastwhichendswithreentryintothemidpacificrecoveryareatheoriginalflightplancalledforseparationofthecmfromthesmtwelveminutesbeforeentryinterfacesuccessfulseparationwouldthentriggerasequenceofburnsintendedtostabilisetheservicemoduleandtomoveitoutofthereentrycorridortoavoiddebriscollisionswiththecommandmoduleduringthereentryphasethereactioncontrolsystemburnsequenceinvolvedboththerollandtheminusxjetstheattitudeburnswereintendedtosetuparollinordertostabiliseremainingfuelandtopreventuncontrolledgyrationduringtheboostthatwouldhavethentakenthesmoutofthereentrycorridorintoahighaltitudeorbitthatwoulddecayonlyafterthecommandmodulehadlandedintheeventthesequenceofburnsdidnotachievetherequiredtrajectoryshiftwithreportsfromtheastronautsonboardandfromacommercialairlinepilotthatthetwospacevehiclesreenteredtheatmospheretogetherwiththecmpassingthesmduringtheplasmaburnphasegiventheproximityofthevehiclesduringreentryitisconsideredhighlyfortunatethatnodebrisfromtherelativelyunprotectedsmstruckthecmandsimulationsshowthatsuchastrikewouldhavebeenlikelytocausecatastrophicdamagetothecmpossibledefectsarisingfromacollisionincludeiheatshielddamageevenaminorcrackinoneoftheheatshieldpanelswouldbelikelytocausesuperheatingwhichcouldbreachthehullleadingtofurthercatastrophicdamagetothevehiclewithprobablelossoflifeiiprematurefiringoftheparachutepyrotechnicsleadingtofullorpartiallossofthedescentarrestsystemandlossoflifeiiidamagetotheparachuteshieldmighthavepreventedthepyrotechnicsfromreleasingtheparachutesleadingtoacatastrophiccollisiononlandingandlossoflifeivdamagetooneormoreoftheparachutescouldhaveledtoahighvelocityimpactwithprobableresultinginjuriesandpossiblelossoflifethehighlikelihoodofcatastrophicfailurearisingfromthedeviationfromflightparametersmeansthatfurtheranalysisoftheseparationburnstrategyisrequiredpendingthatremediationfortheapolloxiireentrytrajectoryisahighpriorityitissuggestedthatsurplusfuelshouldbeejectedfromthesmbeforetheseparationburnbeginsinordertostabilisetheattitudeandthattheminusxburnsshouldbetimedtocoincidewiththerolljetstoimprovestability'"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "column_transposition_decipher(scb, key_b, fillcolumnwise=fillcolumnwise_b, emptycolumnwise=emptycolumnwise_b)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "apollo xi post flight analysis spacecraft reentry trajectory review this document contains\n",
+      "information about the events during there entry phase of apollo xiith as been compiled to satisfy\n",
+      "flight planning safety requirements the review covers the following mission phase trans earth coast\n",
+      "which ends with reentry into the mid pacific recovery area the original flightplan called for\n",
+      "separation of the cm from the sm twelve minutes before entry interface successful separation would\n",
+      "then trigger a sequence of burns intended to stabilise the service module and to move it out of\n",
+      "there entry corridor to avoid debris collisions with the command module during there entry phase the\n",
+      "reaction control system burn sequence involved both the roll and the minus x jets the attitude burns\n",
+      "were intended to setup a rollin order to stabilise remaining fuel and to prevent uncontrolled\n",
+      "gyration during the boost that would have then taken the sm out of there entry corridor into a high\n",
+      "altitude orbit that would decay only after the command module had landed in the event the sequence\n",
+      "of burns did not achieve the required trajectory shift with reports from the astronauts onboard and\n",
+      "from a commercial airline pilot that the two space vehicles reentered the atmosphere together with\n",
+      "the cm passing the sm during the plasma burn phase given the proximity of the vehicles during\n",
+      "reentry it is considered highly fortunate that no debris from the relatively unprotected sms truck\n",
+      "the cm and simulations show that such a strike would have been likely to cause catastrophic damage\n",
+      "to the cm possible defects arising from a collision include i heatshield damage even a minor crack\n",
+      "in one of the heatshield panels would be likely to cause super heating which could breach the hull\n",
+      "leading to further catastrophic damage to the vehicle with probable loss of life ii premature firing\n",
+      "of the parachute pyrotechnics leading to full or partial loss of the descent arrest system and loss\n",
+      "of life iii damage to the parachute shield might have prevented the pyrotechnics from releasing the\n",
+      "parachutes leading to a catastrophic collision on landing and loss of life iv damage to one or more\n",
+      "of the parachutes could have led to a high velocity impact with probable resulting injuries and\n",
+      "possible loss of life the high likelihood of catastrophic failure arising from the deviation from\n",
+      "flight parameters means that further analysis of the separation burn strategy is required pending\n",
+      "that remediation for the apollo xii reentry trajectory is a high priority it is suggested that\n",
+      "surplus fuel should be ejected from the sm before the separation burn begins in order to stabilise\n",
+      "the attitude and that the minus x burns should be timed to coincide with the roll jets to improve\n",
+      "stability\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(lcat(tpack(segment(column_transposition_decipher(scb, key_b, fillcolumnwise=fillcolumnwise_b, emptycolumnwise=emptycolumnwise_b)))))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2756"
+      ]
+     },
+     "execution_count": 26,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "open(plaintext_b_filename, 'w').write(lcat(tpack(segment(column_transposition_decipher(scb, key_b, fillcolumnwise=fillcolumnwise_b, emptycolumnwise=emptycolumnwise_b)))))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/2019/2a.ciphertext b/2019/2a.ciphertext
new file mode 100644 (file)
index 0000000..9d9954b
--- /dev/null
@@ -0,0 +1 @@
+Tjf, B sppx r ippx rs sqj ubij vpd hjes pojw rey bs zrh mdhs r wpsrsbpe nbaqjw raaibjy sp sqj sjks. Rs ubwhs bs zrh qrwy sp hrv bu sqrs zrh r cdf pw r ujrsdwj rey epwtriiv B zpdiy rhhdtj cdf, cds bs hjjtjy pyy sqrs bs zrh sqj peiv ubij sqrs zrh ruujnsjy hp B rhxjy rwpdey sp hjj bu revpej qry hjje revsqbef hbtbirw. Bs sdweh pds sqrs sqbh zrh eps sqj ubwhs erobfrsbpe awpcijt sp qbs sqj awpfwrttj. Fjej wjapwsjy r trmpw bhhdj zbsq sqj fdbyrenj awpfwrttj upw Heppav pe sqj Rapiip Sje tbhhbpe zqbnq npdiy rfrbe qroj nrdhjy r trmpw awpcijt. Upw hptj wjrhpe sqj awpfwrttj npeswpiibef sqj ireybef wryrw zrhe’s dayrsjy zbsq sqj uibfqs aire rey bu Fjej qrye’s wrbhjy sqrs zbsq Bojwhpe sqje sqj cpvh tbfqs qroj qry wjri swpdcij fjssbef crnx. B ippxjy sqwpdfq sqj nptarev ubijh rey updey repsqjw pu pdw tvhsjwbpdhiv upwtrssjy wjapwsh: sqj tjtp beupwtbef sqjt rcpds sqj nqrefj, zqbnq jkairbeh zqv sqj awpfwrttj ejojw fps dayrsjy. Sqbh sbtj sqj nbaqjw zrh re ruubej hqbus, hp hibfqsiv qrwyjw sp nwrnx, cds epsqbef hjwbpdh. Hsbii, bs bh tdnq ijhh ibxjiv sqrs bs zrh r cdf sqrs sbtj, rey be rev nrhj szbnj bh spp tdnq pu r npbenbyjenj. Bs yby hsrws tj zpeyjwbef zqv sqj hjnpey nbaqjw zrh jrhbjw sp nwrnx sqre sqj ubwhs, cds sqje B wjribhjy sqrs sqj ruubej hqbus zrh spp tdnq pu r fbojrzrv. R wpsrsbpe nbaqjw wjriiv npdiy mdhs cj re jenpybef jwwpw, cds sqj ruubej hqbus bh spp hpaqbhsbnrsjy upw r tbhsrxj, hp zqpjojw trefijy sqj wjapwsh tdhs qroj wjribhjy sqjv qry tryj r cbs pu re jwwpw zbsq sqj ubwhs pej rey swbjy sp npojw sqjbw hsjah zbsq sqj hjnpey. Bs bh qrwy sp hjj sqbh rh revsqbef psqjw sqre rssjtasjy hrcpsrfj, cds B rt eps hdwj zqrs sqj tpsboj npdiy cj. B ypdcs bs bh ajwhperi. Sqj Rapiip Sje rey Jijoje nwjzh ype’s pojwira, hp jbsqjw hptjpej qrh r fwdyfj rfrbehs sqj zqpij Rhswperds npwah pw sqjv rwj swvbef sp yjwrbi sqj Rapiip awpfwrttj. Bs npdiy cj sqj Hpobjsh B hdaaphj. Rs ubwhs, B sqpdfqs sqrs sqjbw zbiibefejhh sp hqbus sqj IDER-UBUSJJE pwcbs hqpzjy sqrs sqjv zjwje’s arws pu bs, cds hptjpej be sqj Hsrsj Yjarwstjes apbesjy pds sqrs sqjv tbfqs mdhs qroj qry r fdbisv npehnbjenj, pw cjje xjje sp ybhsrenj sqjthjiojh penj sqj aips zrh ybhnpojwjy. B rt hsbii eps hdwj. Be sqj tjresbtj, npdiy vpd srxj r ippx rs sqj nptadsjw ubijh sp hjj zqp tbfqs qroj qry rnnjhh sp cpsq tjtph, rey zqp tbfqs qroj qry sqj paapwsdebsv rey tjreh sp ypnspw sqjt? B rt uivbef crnx sp Irefijv spebfqs, sp hjj bu sqj Hsrsj Yjarwstjes qroj rev byjrh zqrs tbfqs cj fpbef pe. Ejbi hrby qj npdiy uiv tj da be pej pu sqj ERHR nqrhj airejh, zqbnq bh hptjsqbef B qroj cjje xjje sp swv. B zbii nrii vpd bu B fjs revsqbef.
diff --git a/2019/2a.plaintext b/2019/2a.plaintext
new file mode 100644 (file)
index 0000000..ba8289c
--- /dev/null
@@ -0,0 +1,27 @@
+Meg, I took a look at the file you sent over and it was just a rotation cipher applied to the text.
+At first it was hard to say if that was a bug or a feature and normally I would assume bug, but it
+seemed odd that it was the only file that was affected so I asked around to see if anyone had seen
+anything similar. It turns out that this was not the first navigation problem to hit the programme.
+Gene reported a major issue with the guidance programme for Snoopy on the Apollo Ten mission which
+could again have caused a major problem. For some reason the programme controlling the landing radar
+wasn’t updated with the flight plan and if Gene hadn’t raised that with Iverson then the boys might
+have had real trouble getting back. I looked through the company files and found another of our
+mysteriously formatted reports: the memo informing them about the change, which explains why the
+programme never got updated. This time the cipher was an affine shift, so slightly harder to crack,
+but nothing serious. Still, it is much less likely that it was a bug that time, and in any case
+twice is too much of a coincidence. It did start me wondering why the second cipher was easier to
+crack than the first, but then I realised that the affine shift was too much of a giveaway. A
+rotation cipher really could just be an encoding error, but the affine shift is too sophisticated
+for a mistake, so whoever mangled the reports must have realised they had made a bit of an error
+with the first one and tried to cover their steps with the second. It is hard to see this as
+anything other than attempted sabotage, but I am not sure what the motive could be. I doubt it is
+personal. The Apollo Ten and Eleven crews don’t overlap, so either someone has a grudge against the
+whole Astronaut corps or they are trying to derail the Apollo programme. It could be the Soviets I
+suppose. At first, I thought that their willingness to shift the LUNA-FIFTEEN orbit showed that they
+weren’t part of it, but someone in the State Department pointed out that they might just have had a
+guilty conscience, or been keen to distance themselves once the plot was discovered. I am still not
+sure. In the meantime, could you take a look at the computer files to see who might have had access
+to both memos, and who might have had the opportunity and means to doctor them? I am flying back to
+Langley tonight, to see if the State Department have any ideas what might be going on. Neil said he
+could fly me up in one of the NASA chase planes, which is something I have been keen to try. I will
+call you if I get anything.
\ No newline at end of file
diff --git a/2019/2b.ciphertext b/2019/2b.ciphertext
new file mode 100644 (file)
index 0000000..e642ff8
--- /dev/null
@@ -0,0 +1,17 @@
+Kdarra Pwx
+Mdkqwqjkzp Adwjkpiaxkr Pjklwqpaje
+Zijmp Jwvimiax
+Pfim taqsuwxp qaxpkixm sdtkpwt ixzajukpiax knasp pfw drkxxwt rsxkj ajnipkr adwjkpiaxm zaj pfw uimmiax kxt fkm nwwx qaudirwt pa mkpimze zricfp qjwy/zricfp qaxpjarrwj pjkixixc kxt miusrkpiax jwgsijwuwxpm.
+
+Pfw zarrayixc uimmiax dfkmwm jwukix SXQFKXCWT zjau pfw ajicixkr drkx:
+Rksxqf, yfiqf wxtm yipf ixmwjpiax ixpa wkjpf dkjoixc ajnip (WDA).
+Wkjpf ajnip qakmp, yfiqf wxtm yipf Pjkxmrsxkj Ixlwqpiax (PRI).
+Pjkxm Rsxkj qakmp, yfiqf wxtm yipf Rsxkj Ajnip Ixmwjpiax (RAI).
+Pjkxm Wkjpf qakmp, yfiqf wxtm yipf jw-wxpje ixpa pfw uit-Dkqiziq jwqavwje kjwk.
+
+Pfw papkr uimmiax tsjkpiax yirr nw kddjabiukpwre WICFP tkem.
+
+Pfw jwdajp ixqrstwm micxiziqkxp qfkxcwm pa Rsxkj ajnipkr adwjkpiaxm, yfiqf mpkjp kp RAI kxt wxt yipf Pjkxm Wkjpf rxlwqpiax. XAPW PFWMW IUDAJPKXP PJKLWQPAJE QFKXCWM
+
+Pfw djiuw anlwqpivw az pfw RAI-PWI dfkmw yirr nw pa twuaxmpjkpw krr
+qaudaxwxpm az Uimmiax C wbqwdp pfamw yfiqf tijwqpre ixvarvw Rsxkj Uatsrw daywjwt twmqwxp kxt daywjwt kmqwxp.
diff --git a/2019/2b.plaintext b/2019/2b.plaintext
new file mode 100644 (file)
index 0000000..cbe2084
--- /dev/null
@@ -0,0 +1,17 @@
+Apollo Ten
+Spacecraft Operational Trajectory
+First Revision
+This document contains updated information about the planned lunar orbital operations for the mission and has been compiled to satisfy flight crew/flight controller training and simulation requirements.
+
+The following mission phases remain UNCHANGED from the original plan:
+Launch, which ends with insertion into earth parking orbit (EPO).
+Earth orbit coast, which ends with Translunar Injection (TLI).
+Trans Lunar coast, which ends with Lunar Orbit Insertion (LOI).
+Trans Earth coast, which ends with re-entry into the mid-Pacific recovery area.
+
+The total mission duration will be approximately EIGHT days.
+
+The report includes significant changes to Lunar orbital operations, which start at LOI and end with Trans Earth lnjection. NOTE THESE IMPORTANT TRAJECTORY CHANGES
+
+The prime objective of the LOI-TEI phase will be to demonstrate all
+components of Mission G except those which directly involve Lunar Module powered descent and powered ascent.
diff --git a/2019/3a.ciphertext b/2019/3a.ciphertext
new file mode 100644 (file)
index 0000000..ec6dfa2
--- /dev/null
@@ -0,0 +1,11 @@
+Wshhp,
+
+X msdjru je ar trhjsxd jwr beij Sfebbe Jrd hrfehj hrsbbp msid’j sd sttxurdj ie X sizru shtwxlri je irshtw jwr cxiixed fsfrhi xd tsir jwr ehxvxdsb hrfehj wsu arrd cxinxbru. Jwrp irshtwru rlrhpjwxdv sdu tekbud’j nxdu xj akj jwrd iecredr wsu s ahsxdmslr sdu twrtzru jwr Sfebbe rbrlrd nxbri. Je rlrhpedr’i hrbxrn jwrp nekdu xj jwrhr sdu jwr shtwxlxij hrtzedru jwsj iecredr vej uxijhstjru. Mxjw jwr lebkcr en cxiixed fsfrhi jwrp shr wsdubxdv jwxi xi dej s ikhfhxir, akj vxlrd jwr xcfehjsdtr en jwrir uetkcrdji xj xi s axj sbshcxdv sdu uerid’j nrrb bxzr jwr msp DSIS kiksbbp ueri jwxdvi. Sdpmsp, jwr nxdu iwekbu wslr hrsiikhru cr, sdu xj mekbu wslr xn X wsud’j beezru ie tshrnkbbp sj jwr nxbr. Rlrhpjwxdv beezru nxdr rotrfj jwsj jwr mehu Xdyrtjxed xd jwr frdkbjxcsjr fshsvhsfw msi ifrbj mxjw sd X. Pek csp dej ar ikhfhxiru, akj xn pek beez sj jwr urthpfj en jwr csdvbru lrhixed xj xi cxiifrbj bdyrtjxed, mxjw sd b hrfbstxdv jwr X.
+
+X mekbud’j wslr dejxtru akj X wsu urthpfjru jwr ehxvxdsb ap wsdu sdu msi ikhfhxiru ap jwr jpfe. Xj ijktz xd cp cxdu ie mwrd X ism jwr nxbru lrhixed mxjwekj xj jwsj hsdv sbshc arbbi. Edtr mr ijshjru xdlrijxvsjxdv mr betzru kf jwr tecfkjrh nxbri ie X tsd edbp siikcr jwsj jwr nxbru lrhixed msi jhsdithxaru ap iecredr mwe dem wsi sttrii je jwr fhxdjru lrhixed akj mwe uerid’j wslr jwr tbrshsdtr je sttrii jwr ehxvxdsb. Jwr gkrijxed xi, mwp mekbu jwrp fheuktr s drm lrhixed? X tsd edbp jwxdz jwsj jwrp msdjru je wrsu enn cehr xdlrijxvsjxed ap vxlxdv ki s hrsied je jwxdz xj msi sbb s cxijszr snjrh sbb. Xn jwsj msi jwr fbsd jwrd xj wsid’j mehzru. Xj irrci tbrsh je cr jwsj iecredr hrsbbp ueri wslr iecrjwxdv je wxur.
+
+X twrtzru jwr irtkhxjp tbrshsdtr bxij sdu jwrhr mrhr jme wkduhru sdu jwxhjp-irlrd frefbr mxjw sttrii je jwr shtwxlr heec mwrhr mr shr ijehxdv jwr xdlrijxvsjxed nxbri mwe ue dej sbie wslr tkhhrdj sttrii je jweir tecfkjrh nxbri. En jweir, edr wkduhru sdu rxvwjrrd uxu wslr jrhcxdsb sttrii arnehr mr tbeiru xj uemd, ie jwr ikifrtj bxij xi iwhxdzxdv, mwxtw X ikffeir xi iecrjwxdv, akj X mekbu fhrnrh je dshhem xj uemd s axj cehr. Mxjw jwr bskdtw en Sfebbe Jmrblr tecxdv kf droj cedjw jwr ceeu xi vrjjxdv jrdir sdu X mekbu hrsbbp bxzr je cszr ikhr ekh cxitwxrn cszrh uerid’j wslr sdp cehr ikhfhxiri xd ijehr.
+
+Je cszr csjjrhi mehir X wrshu jwsj jwr wsmzi sj jwr Frdjsved shr vrjjxdv hrijbrii. Tekbu pek vrj elrh jwrhr sdu nxdu ekj mwsj jwrp shr jwxdzxdv? Vxlrd jwsj ekh jehcrdjeh irrci je wslr fhrjjp wxvw-brlrb sttrii, cspar pek tekbu thsdz kf jwr irtkhxjp ed ekh tecci? Cspar s zrpmehu txfwrh abetzru si ijsdushu?
+
+Crv
diff --git a/2019/3a.plaintext b/2019/3a.plaintext
new file mode 100644 (file)
index 0000000..2cd2796
--- /dev/null
@@ -0,0 +1,11 @@
+Harry,
+
+I wanted to be certain the lost Apollo Ten report really wasn’t an accident so I asked archives to search the mission papers in case the original report had been misfiled. They searched everything and couldn’t find it but then someone had a brainwave and checked the Apollo eleven files. To everyone’s relief they found it there and the archivist reckoned that someone got distracted. With the volume of mission papers they are handling this is not a surprise, but given the importance of these documents it is a bit alarming and doesn’t feel like the way NASA usually does things. Anyway, the find should have reassured me, and it would have if I hadn’t looked so carefully at the file. Everything looked fine except that the word Injection in the penultimate paragraph was spelt with an I. You may not be surprised, but if you look at the decrypt of the mangled version it is misspelt lnjection, with an l replacing the I.
+
+I wouldn’t have noticed but I had decrypted the original by hand and was surprised by the typo. It stuck in my mind so when I saw the filed version without it that rang alarm bells. Once we started investigating we locked up the computer files so I can only assume that the filed version was transcribed by someone who now has access to the printed version but who doesn’t have the clearance to access the original. The question is, why would they produce a new version? I can only think that they wanted to head off more investigation by giving us a reason to think it was all a mistake after all. If that was the plan then it hasn’t worked. It seems clear to me that someone really does have something to hide.
+
+I checked the security clearance list and there were two hundred and thirty-seven people with access to the archive room where we are storing the investigation files who do not also have current access to those computer files. Of those, one hundred and eighteen did have terminal access before we closed it down, so the suspect list is shrinking, which I suppose is something, but I would prefer to narrow it down a bit more. With the launch of Apollo Twelve coming up next month the mood is getting tense and I would really like to make sure our mischief maker doesn’t have any more surprises in store.
+
+To make matters worse I heard that the hawks at the Pentagon are getting restless. Could you get over there and find out what they are thinking? Given that our tormentor seems to have pretty high-level access, maybe you could crank up the security on our comms? Maybe a keyword cipher blocked as standard?
+
+Meg
diff --git a/2019/3b.ciphertext b/2019/3b.ciphertext
new file mode 100644 (file)
index 0000000..a24ea19
--- /dev/null
@@ -0,0 +1 @@
+WKMPC ZKXDV SYEZU KYLTV ICYFK BVDDN KZKXD VMYXO BPKLP XMDNK CDVLL VXTDB IPXMD YMVEM KDNKW YYTDN KBKIY EVBKB PMNDD NKNVG RCVBK MKDDP XMZBK DDIBK CDUKC CVXTN VFKWY BKYBU KCCTK SPTKT VUBKV TIDNV DDNKC YFPKD CVBKD YOUVW KLYBB KSKXD KFKXD CYXDN KVZYU UYZBY MBVWW KCYWK YLDNK MKXKB VUCTY XDXKK TWESN YLVXK HSECK DYDEB XEZDN KNKVD OEDIY ETYXD MKDLY EBCDV BCGPD NYEDE XTKBC DVXTP XMDNK XKKTL YBZYU PDPSV UCEZZ YBDVX TDNKB KNVCO KKXVS YXSKB DKTGN PCZKB PXMSV WZVPM XDYSY XFPXS KDNKZ BKCPT KXDDY DVRKV CDBYX MUPXK DNKWY CDCDB PTKXD VBKSV UUPXM LYBVU VBMKO EPUTE ZYLLY BSKCV UYXMD NKOYB TKBGP DNKVC DMKBW VXIVC VCNYG YLCDB KXMDN VBMEP XMDNV DDNKV DDVSR YXDNK CZVSK ZBYMB VWWKW ECDNV FKOKK XVEDN YBPCK TOIDN KZYUP DOEBY DNVDW VRKCX YCKXC KDYWK LPBCD DNKBE CCPVX CVBKW YBKUP RKUID YDBID YGPXD NKZBY ZVMVX TVGVB DNVXD YBPCR SYXLU PSDVX TCKSY XTDNK CVOYD VMKPL DNVDP CGNVD PDPCP CXDCY ZNPCD PSVDK TKXYE MNLYB VRMOY ZKBVD PYXOE DPDPC NVBTD YSYXF PXSKD NKMKX KBVUC DNVDD NVDPC DBEKC YWKYL DNKWY BKSVE DPYEC ZUVXX KBCWY CDUID NYCKG NYVSD EVUUI LYEMN DPXDN KUVCD GVBNV FKWVX VMKTD YOUYS RDNKO EPUTE ZZBYZ YCPXM VXKGD BVXSN KYLGV BMVWK CPXCD KVTWY OPUPC PXMDN VDGVI PCCDP UUVZB YFYSV DPYXO EDPCU KCCUP RKUID YVSSP TKXDV UUIDB PMMKB VGVBK CZKSP VUUIP LGKXY DPLIZ VFUYF CRIPX VTFVX SKVUU DNKCV WKWIY GXDPW KPXOK BUPXS YXFPX SKTWK GKNVF KDYDB KVTFK BICYL DUIDN KBKCY PNKVT KTYFK BDYUV XMUKI VXTSY XFPXS KTDNK WDYCE MMKCD VXVUD KBXVD PFKGK GPUUC DKZEZ PXCZK SDPYX CVDSN KSRZY PXDSN VBUPK DYWVR KPDNV BTKBL YBCYF PKDVM KXDCD YSBYC CVXTS BVXRE ZDNKD KELKU COKBM UPCDK XPXMY ZKBVD PYXDY CKKPL DNVDD EBXCE ZVXID NPXMB KUVDK TPVWV UCYMY PXMDY CKXTV SYEZU KYLYE BOKCD YFKBD YOVPR YXEBD YDBIV XTLPX TYEDG NVDPC MYPXM YXDNK BKDNK CYFPK DCVBK ZBKDD ICKSB KDPFK VOYED DNKPB YGXCZ VSKZB YMBVW WKVXT GPDNY EDDNK GYBUT CZBKC CGVDS NPXMG KTYXD BKVUU INVFK VSUKV BZPSD EBKYL DNKPB ZBYMB KCCYB DNKPB ZUVXC EXUKC CDNKI VBKSU YCKDY ZEDDP XMDNK PBYGX WKXYX DNKWY YXPSV XDCKK GNVDD NKINV FKDYM VPXGP DNGNV DCKKW CDYOK VLVPB UITPC YBMVX PCKTV DDKWZ DDYTK BVPUY EBCZV SKZBY MBVWW KOEDP GYEUT CDPUU UPRKD YRXYG GNVDD NKIVB KEZDY RKKZV SUYCK KIKYX DNKWP CCPYX ZUVXX PXMVX TUKDW KRXYG PLIYE NKVBV XIDNP XMGYB BIPXM PGPUU OKOVS RVOYE DVGKK ROKLY BKDNK UVEXS NNVBB I
diff --git a/2019/3b.plaintext b/2019/3b.plaintext
new file mode 100644 (file)
index 0000000..55d6944
--- /dev/null
@@ -0,0 +1,24 @@
+megis penta couple of days over at the pentagon briefing the staff and trying to gauge the mood
+there you are right the hawks are getting pretty restless and have more or less decided already that
+the soviets are to blame for recent events on the apollo programme some of the generals dont need
+much of an excuse to turn up the heat but you dont get four stars without understanding the need for
+political support and there has been a concerted whispering campaign to convince the president to
+take a strong line the most strident are calling for a large buildup of forces along the border with
+east germany as a show of strength arguing that the attack on the space programme must have been
+authorised by the politburo that makes no sense to me first the russians are more likely to try to
+win the propaganda war than to risk conflict and second the sabotage if that is what it is isnt
+sophisticated enough for a kgb operation but it is hard to convince the generals that that is true
+some of the more cautious planners mostly those who actually fought in the last war have managed to
+block the buildup proposing a new tranche of wargames instead mobilising that way is still a
+provocation but is less likely to accidentally trigger aware specially if we notify pavlovsky in
+advance all the same my own time in berlin convinced me we have to tread very softly there so i
+headed over to langley and convinced them to suggest an alternative we will step up inspections at
+checkpoint charlie to make it harder for soviet agents to cross and crank up the teufel s berg
+listening operation to see if that turns up anything related i am also going to send a couple of our
+best over to baikonur to try and find out what is going on there the soviets are pretty secretive
+about their own space programme and without the worlds press watching we dont really have a clear
+picture of their progress or their plans unless they are close to putting their own men on the moon
+icant see what they have to gain with what seems to be a fairly disorganised attempt to derail our
+space programme but i would still like to know what they are up to keep a close eye on the mission
+planning and let me know if you hear anything worrying i will be back about a week before the launch
+harry
\ No newline at end of file
diff --git a/2019/4a.ciphertext b/2019/4a.ciphertext
new file mode 100644 (file)
index 0000000..ed07bb7
--- /dev/null
@@ -0,0 +1,4 @@
+BRT,
+W VLKR URRC MDGYWCT IVGDJTV IVR ZWHI DS HJHEWNWDJH WCNWARCIH LSSRNIWCT LEDZZD RZRKRC LCA WI WH ZDCTRG IVLC PDJ BWTVI IVWCY. IVR EGR-ZLJCNV, HILTR IVGRR IVGJHIRG KLZKR EGDUZRB WH L ZWIIZR HJHEWNWDJH TWKRC LZZ IVR NVRNYH IVLI IDDY EZLNR URSDGR IVLI, UJI DC IVR DIVRG VLCA IRZRBRIGP TJLGLCIRRA IVLI WI MDJZA UR ARIRNIRA LCA IVR IRNVCWNWLCH HVDMRA IVLI WI MLH RLHP ID UPELHH. WS IVLI MLH L HLUDILTR LIIRBEI IVRC WI MLHC'I KRGP MRZZ ARHWTCRA, HD W ADC'I IVWCY WI NDJZA VLKR URRC LC RCTWCRRG IVLI HRI WI JE. DC IVR DIVRG VLCA, CD-DCR RZHR MDJZA VLKR VLA IWBR LZDCR MWIV IVR NDBEDCRCI. DC IVR DIVRG VLCA, HDBRDCR SGDB SWAD'H IRLB HRCI BR L BRHHLTR ID IRZZ BR LUDJI L KRGP CRLG BWHH IVLI HDJCAH ZWYR WI NDJZA VLKR URRC L HRGWDJH LIIRBEI ID ARHIGDP IVR NDBBLCA BDAJZR DC GR-RCIGP.
+LH LEDZZD OW LEEGDLNVRA IVR GR-RCIGP EDWCI IVRP XRIIWHDCRA IVR HRGKWNR BDAJZR ID GR-DGWRCI IVR NDBBLCA BDAJZR HD IVLI IVR VRLIHVWRZA MLH EDWCIWCT WCID IVR LIBDHEVRGR. HWCNR IVRP MRGR DC EGRIIP BJNV L ULZZWHIWN DGUWI IVR HB MDJZA VLKR HILPRA NZDHR ID IVR NB, LCA MWIVDJI L VRLIHVWRZA DS WIH DMC WI MDJZA UGRLY JE WCID ZLGTR EWRNRH IVLI EDHRA L HWTCWSWNLCI ALCTRG ID IVR NB LCA WIH NGRM. ID LKDWA IVLI IVR HB MLH HJEEDHRA ID NLGGP DJI L HRFJRCNR DS HVDGI UJGCH ID BDKR WIH IGLXRNIDGP LMLP SGDB IVR NDBBLCA BDAJZR, HYWEEWCT WI DSS IVR LIBDHEVRGR HD IVLI IVR NB NDJZA GR-RCIRG SGRR SGDB IVR ARUGWH SWRZA. JCSDGIJCLIRZP, IVLI ADRHC'I HRRB ID VLKR VLEERCRA. LZAGWC GREDGIRA IVLI IVR NB SZRM ELHI IVR HB MVWNV MLH SZPWCT LI LC LIILNY LCTZR MRZZ URPDCA DERGLIWDCLZ ELGLBRIRGH, LCA L NDBBRGNWLZ EWZDI, SGLCY UGDMC, GREDGIRA HRRWCT IVR IMD HELNRNGLSI IGLNYWCT NZDHRZP LH IVRP UJGCRA IVGDJTV IVR LIBDHEVRGR. L HWCTZR NDZZWHWDC MWIV DCR DS IVR MVWIR-VDI SGLTBRCIH NDJZA VLKR ULAZP ALBLTRA IVR GR-RCIGP NLEHJZR, LCA RKRC WS IVR LHIGDCLJIH VLA HJGKWKRA IVR NDZZWHWDC IVRC IVR DAAH LGR IVLI IVR ELGLNVJIR HPHIRB MDJZA VLKR IGWTTRGRA RLGZP DG URRC SLILZZP ALBLTRA UP IVR UZLHI. CLHL RCTWCRRGH LGR MDGYWCT SLHI ID NDGGRNI IVR EGDUZRB SDG LEDZZD OWWW LCA IVRP VLKR BWIWTLIWDCH WC EZLNR SDG OWW'H GR-RCIGP, UJI IVR KWRM DS IVR ROERGIH WH IVLI IVRP ADATRA L UJZZRI MWIV IVWH. IVR SZWTVI DSSWNRG MVD GREDGIRA WI ID BR EDWCIRA DJI IVLI WS IVR HDKWRIH MLCIRA ID HLUDILTR IVR BWHHWDC IVWH BWTVI VLKR URRC L TDDA URI: WI MLH L CLHIP LNNWARCI IVLI MLH VLGA ID SDGRHRR, LCA WI MWZZ UR KRGP AWSSWNJZI ID HVDM IVLI HDBRDCR ARZWURGLIRZP BWHNLZNJZLIRA IVR UJGC IWBRH HWCNR WI MLH IVR WCIRGLNIWDC DS IVR IVGJHIRGH LCA HILUWZWHRGH IVLI NLJHRA IVR EGDUZRB. W IVWCY VR WH DCR DS L TGDMWCT CJBURG DS CLHL RBEZDPRRH MVD VLKR URTJC ID URZWRKR IVLI IVR JHHG VLH ARRE NDKRG LTRCIH MDGYWCT ID ARHILUWZWHR IVR EGDTGLBBR. BP MDGGP WH IVLI RKRC WS VR WH MGDCT, IVR ZLNY DS IGJHI IVLI WH TGDMWCT MWIVWC IVR DGTLCWHLIWDC MWZZ ARHILUWZWHR WI DC WIH DMC. W LB GRLZZP VDEWCT VR WH BWHILYRC. IVR HJNNRHH DS LEDZZD OW HRRBH ID VLKR UDJTVI L ZDI DS WCIRGCLIWDCLZ TDDAMWZZ LCA W IVWCY WI NDJZA UR IVR HILGI DS HDBRIVWCT BDGR EDHWIWKR. IVR HDKWRI NDDERGLIWDC MWIV IVR ZLCAWCT TLKR BR VDER IVLI MR NDJZA SWCA BDGR NDBBDC TGDJCA LCA HILGI ID IVLM RLHI-MRHI GRZLIWDCH, UJI IVWH NDJZA GRLZZP IVGRLIRC IVLI.
+WC IVR BRLC-IWBR MR VLA URIIRG HIRE JE HRNJGWIP. W IVWCY MR HVDJZA JHR L HWBEZR KWTRCRGR NWEVRG MWIV ERGWDA IMD SDG DJG CROI BRHHLTR. W VLKR RCNGPEIRA IVR LIILNVRA GR-RCIGP GREDGI JHWCT L NDZJBCLG IGLCHEDHWIWDC NWEVRG
diff --git a/2019/4a.plaintext b/2019/4a.plaintext
new file mode 100644 (file)
index 0000000..e5305e8
--- /dev/null
@@ -0,0 +1,4 @@
+MEG,
+I HAVE BEEN WORKING THROUGH THE LIST OF SUSPICIOUS INCIDENTS AFFECTING APOLLO ELEVEN AND IT IS LONGER THAN YOU MIGHT THINK. THE PRE-LAUNCH, STAGE THREE THRUSTER VALVE PROBLEM IS A LITTLE SUSPICIOUS GIVEN ALL THE CHECKS THAT TOOK PLACE BEFORE THAT, BUT ON THE OTHER HAND TELEMETRY GUARANTEED THAT IT WOULD BE DETECTED AND THE TECHNICIANS SHOWED THAT IT WAS EASY TO BYPASS. IF THAT WAS A SABOTAGE ATTEMPT THEN IT WASN'T VERY WELL DESIGNED, SO I DON'T THINK IT COULD HAVE BEEN AN ENGINEER THAT SET IT UP. ON THE OTHER HAND, NO-ONE ELSE WOULD HAVE HAD TIME ALONE WITH THE COMPONENT. ON THE OTHER HAND, SOMEONE FROM FIDO'S TEAM SENT ME A MESSAGE TO TELL ME ABOUT A VERY NEAR MISS THAT SOUNDS LIKE IT COULD HAVE BEEN A SERIOUS ATTEMPT TO DESTROY THE COMMAND MODULE ON RE-ENTRY.
+AS APOLLO XI APPROACHED THE RE-ENTRY POINT THEY JETTISONED THE SERVICE MODULE TO RE-ORIENT THE COMMAND MODULE SO THAT THE HEATSHIELD WAS POINTING INTO THE ATMOSPHERE. SINCE THEY WERE ON PRETTY MUCH A BALLISTIC ORBIT THE SM WOULD HAVE STAYED CLOSE TO THE CM, AND WITHOUT A HEATSHIELD OF ITS OWN IT WOULD BREAK UP INTO LARGE PIECES THAT POSED A SIGNIFICANT DANGER TO THE CM AND ITS CREW. TO AVOID THAT THE SM WAS SUPPOSED TO CARRY OUT A SEQUENCE OF SHORT BURNS TO MOVE ITS TRAJECTORY AWAY FROM THE COMMAND MODULE, SKIPPING IT OFF THE ATMOSPHERE SO THAT THE CM COULD RE-ENTER FREE FROM THE DEBRIS FIELD. UNFORTUNATELY, THAT DOESN'T SEEM TO HAVE HAPPENED. ALDRIN REPORTED THAT THE CM FLEW PAST THE SM WHICH WAS FLYING AT AN ATTACK ANGLE WELL BEYOND OPERATIONAL PARAMETERS, AND A COMMERCIAL PILOT, FRANK BROWN, REPORTED SEEING THE TWO SPACECRAFT TRACKING CLOSELY AS THEY BURNED THROUGH THE ATMOSPHERE. A SINGLE COLLISION WITH ONE OF THE WHITE-HOT FRAGMENTS COULD HAVE BADLY DAMAGED THE RE-ENTRY CAPSULE, AND EVEN IF THE ASTRONAUTS HAD SURVIVED THE COLLISION THEN THE ODDS ARE THAT THE PARACHUTE SYSTEM WOULD HAVE TRIGGERED EARLY OR BEEN FATALLY DAMAGED BY THE BLAST. NASA ENGINEERS ARE WORKING FAST TO CORRECT THE PROBLEM FOR APOLLO XIII AND THEY HAVE MITIGATIONS IN PLACE FOR XII'S RE-ENTRY, BUT THE VIEW OF THE EXPERTS IS THAT THEY DODGED A BULLET WITH THIS. THE FLIGHT OFFICER WHO REPORTED IT TO ME POINTED OUT THAT IF THE SOVIETS WANTED TO SABOTAGE THE MISSION THIS MIGHT HAVE BEEN A GOOD BET: IT WAS A NASTY ACCIDENT THAT WAS HARD TO FORESEE, AND IT WILL BE VERY DIFFICULT TO SHOW THAT SOMEONE DELIBERATELY MISCALCULATED THE BURN TIMES SINCE IT WAS THE INTERACTION OF THE THRUSTERS AND STABILISERS THAT CAUSED THE PROBLEM. I THINK HE IS ONE OF A GROWING NUMBER OF NASA EMPLOYEES WHO HAVE BEGUN TO BELIEVE THAT THE USSR HAS DEEP COVER AGENTS WORKING TO DESTABILISE THE PROGRAMME. MY WORRY IS THAT EVEN IF HE IS WRONG, THE LACK OF TRUST THAT IS GROWING WITHIN THE ORGANISATION WILL DESTABILISE IT ON ITS OWN. I AM REALLY HOPING HE IS MISTAKEN. THE SUCCESS OF APOLLO XI SEEMS TO HAVE BOUGHT A LOT OF INTERNATIONAL GOODWILL AND I THINK IT COULD BE THE START OF SOMETHING MORE POSITIVE. THE SOVIET COOPERATION WITH THE LANDING GAVE ME HOPE THAT WE COULD FIND MORE COMMON GROUND AND START TO THAW EAST-WEST RELATIONS, BUT THIS COULD REALLY THREATEN THAT.
+IN THE MEAN-TIME WE HAD BETTER STEP UP SECURITY. I THINK WE SHOULD USE A SIMPLE VIGENERE CIPHER WITH PERIOD TWO FOR OUR NEXT MESSAGE. I HAVE ENCRYPTED THE ATTACHED RE-ENTRY REPORT USING A COLUMNAR TRANSPOSITION CIPHER
diff --git a/2019/4b.ciphertext b/2019/4b.ciphertext
new file mode 100644 (file)
index 0000000..a555f52
--- /dev/null
@@ -0,0 +1 @@
+OOHSE ERRWC OITUE IEHPI ELTIN FUTVE OGNRT WDENI IETIG COATO TIETR CLTLR SESEB HCEOT EOTDO NHNET TECNS NCVTA ITTUE EUITL AUOTR YDHTL HNURC RITIO AFCMA DVSES ATIJS TTHNB DOANT TEEEA ETHAH ILRGE IEEGY NDFTO FREOS KNAHS RLELS TDOOD AFLII IAARN HELBY EEHLH LGHSC THTBO IUNPT ELTRL TESMS IGPTD AEECR AEUDC OLONS EGOFA CVALM TBLJN BOHIO AIRNH TMPES RAFAB ARDGM OEXTE SRIGH LSEDE RPNGR TEIDE BOIOW RSOIL TASRN JRHMT FOTTG NSLHC DSHIT RTESL IHNCI WNOPR YEATL SIETE UOYAE EOTGQ FNTLS MNEFN RABLW CMUEY HIREE IDEDU TTNNT AOSSN LRNLA RBAHN HOERN HDTLO EMDLN NQFIH EECIR FAUAR MAPAO EREME EHSSG SPVRY EDETI IRTEO LYESH SIWCK HNTCO MHSFI OICEL EICOA DWLOU TCBHE ORRAT CPELR EORPH AFAOE TSNFI TRSIE TYNMI AENTH ILAOV TMHHU LICAP EIRPE LHEOT FAFDO LRSHH YHARE QEHDF PIYTH OISTS OJRMT RUNEB HUHIR LENTL OEILS TICEA YTUNN ITNNE AOTNE IGNEI SIRLM PAHHS ETDCR HNHAR THMWN FRFCS IDIEO IDIEE AVOER OELSE DDHRT TTTSE EHNNS IRIDP NOIIE PUORU EHDET TEOIG UTUYT OODIE EODCH REHHS EAOFM LEHWV SRTRH TSENA NIPTV SRISH OEDRE LTMTD TOUID EYERA TSERR LNHEG MAEEL SETSA IDTLT ETDOI HLFPR GAECE OPLHN TAOIE AEMVN PHOSP TIAPL NGSIE RTCOE HOPHL TUDLF EKDSC EGEIF ARTTL TRUTE PTENA IRCAI TEAUH EFSEA BIDAT TTMUU MIIOT VLPPG YCRTO EOCSA OVRRP AIEIA LAAQN EVFNO TRTNR IMFVA GINFR FRMMB NEUUA UTACN DATIL MURCR DCOTA LGNSA OYRNL HLMET BRDTL RIMFT NTGNT TUTEO EYOHI BWCAE DHEEE CNTEU AYIRT ONNCI ITECL TEHET PTRPU EHMHL NROEY ANSEV RDCAL STTUB EUSCT PESGO NEHMN COEIE DLSHW UCLNT AIEEI ASITI EUTSG OAFCE ESEAE ULHVH EFEHH AARON IOFAE ORSAO EIIAU NAIST LOTHU ITAOT TNUNO PNRSE NEIHO NJIPY GTPLB EHOEO EOSST NHXHT CEETR BAIIL ATYTI DTNMB EUEYF XBPSF LSEER OEIIE ASEHY EIOEI LADAO FSESE TSFRO NRNRN TEVUO OEYOI SIHMU NEAEC SUEOT LEJAE ENELE BEGDE NDOGS OEKMH RDATR TEYHN EDEHN ROVQR RWOMR OAACL OHACN HPGIM GUEBS TITCI TCRLN TIHIP EUMUS ASOEK AAIEM LTNCO DSAER NHHNL EURGO AUIRT HGVWB SEARH HOCNL IOSRT OFMHH ETETT SLTCE OTCOD LIMNE AEHTV YWBSI SSSEH HAPLS MIRHE AFASE OTIRI RTTLE AYHTU DREDT TFSIB NOITA TSSEO DHEPA XLAPF RCVSN IRAED HROOS MOYPG RMECH WSSEA HTRHC CRRFL EPNME VEENE SAWEE EUESS RDTTH RDOIS TMDIE HRNLB UVOOH XEDWE SODAR NNVOE INOWV ASTTI OLOAD LTALN HTEUN EETOT POTSD MRRLT PIETS OWCND HAANX FIRNS EHUAR TTNTR CMNHA WVICT HGCBC IAIUT DVOIT SAUKA ENCEH DUAPA EEOOF MITCR IILTS ERSLI ATCIH RDOCE GALTS CINDL AORPT DDHTT OEGES OFGIC OIIOV FGMET RISIS YIDTA RLERR GISEU ULCME ETNIT LAETU SBTIT JMTYO FNSAT EEIEA ONHST TELAO TFTNY EHWTO SASOC ITTAE AOLPL EOCHL TRICS PNHGU BTOIE ODITT IVRII OORRP EOOMQ NBRTS HUSTO RRTEI AECLT IOTAT EFNRT AEHDN RMUAT TUBDI RDTFE RSTRO EIITS HEDOT REIMT MHEOO HUEID GTHBM AUCTE IOTHE ALOAP AEIES MSLAD ENKFT POICP IHREA FCOMH LRLIE FFAYN DURSD AYDLD OAHGP ERIRN RSGAI SANFD OOEUL EGICR RNIOL IILFR ARREN IAMAE SETNG UNAIO ORTOI RSTSF UEOBH ARSRI EDANN DDCHL IST
diff --git a/2019/4b.plaintext b/2019/4b.plaintext
new file mode 100644 (file)
index 0000000..074916f
--- /dev/null
@@ -0,0 +1,29 @@
+apollo xi post flight analysis spacecraft reentry trajectory review this document contains
+information about the events during there entry phase of apollo xiith as been compiled to satisfy
+flight planning safety requirements the review covers the following mission phase trans earth coast
+which ends with reentry into the mid pacific recovery area the original flightplan called for
+separation of the cm from the sm twelve minutes before entry interface successful separation would
+then trigger a sequence of burns intended to stabilise the service module and to move it out of
+there entry corridor to avoid debris collisions with the command module during there entry phase the
+reaction control system burn sequence involved both the roll and the minus x jets the attitude burns
+were intended to setup a rollin order to stabilise remaining fuel and to prevent uncontrolled
+gyration during the boost that would have then taken the sm out of there entry corridor into a high
+altitude orbit that would decay only after the command module had landed in the event the sequence
+of burns did not achieve the required trajectory shift with reports from the astronauts onboard and
+from a commercial airline pilot that the two space vehicles reentered the atmosphere together with
+the cm passing the sm during the plasma burn phase given the proximity of the vehicles during
+reentry it is considered highly fortunate that no debris from the relatively unprotected sms truck
+the cm and simulations show that such a strike would have been likely to cause catastrophic damage
+to the cm possible defects arising from a collision include i heatshield damage even a minor crack
+in one of the heatshield panels would be likely to cause super heating which could breach the hull
+leading to further catastrophic damage to the vehicle with probable loss of life ii premature firing
+of the parachute pyrotechnics leading to full or partial loss of the descent arrest system and loss
+of life iii damage to the parachute shield might have prevented the pyrotechnics from releasing the
+parachutes leading to a catastrophic collision on landing and loss of life iv damage to one or more
+of the parachutes could have led to a high velocity impact with probable resulting injuries and
+possible loss of life the high likelihood of catastrophic failure arising from the deviation from
+flight parameters means that further analysis of the separation burn strategy is required pending
+that remediation for the apollo xii reentry trajectory is a high priority it is suggested that
+surplus fuel should be ejected from the sm before the separation burn begins in order to stabilise
+the attitude and that the minus x burns should be timed to coincide with the roll jets to improve
+stability
\ No newline at end of file
index 2db454cb3ef23e953a83d9129e174906ce2596a5..a135c2b0489f14e8d6835a716fbe7bfb611f8739 100644 (file)
@@ -206,8 +206,6 @@ def simulated_annealing_break(message, workers=10,
                               fitness=Ptrigrams, chunksize=1):
     worker_args = []
     ciphertext = sanitise(message)
-    if swap_index_finder is None:
-        swap_index_finder = gaussian_swap_index
     for i in range(workers):
         if plain_alphabet is None:
             used_plain_alphabet = string.ascii_lowercase
@@ -300,4 +298,4 @@ def simulated_annealing_break_worker(message, plain_alphabet, cipher_alphabet,
     return best_alphabet, best_fitness # current_alphabet, current_fitness
 
 if __name__ == "__main__":
-    import doctest
\ No newline at end of file
+    import doctest