--- /dev/null
+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?
--- /dev/null
+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?
--- /dev/null
+{
+ "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
+}