Tweaked reversing in part 6
authorNeil Smith <neil.git@njae.me.uk>
Fri, 22 Nov 2019 08:03:42 +0000 (08:03 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Fri, 22 Nov 2019 08:03:42 +0000 (08:03 +0000)
2019/2019-challenge6.ipynb
2019/6b.plaintext

index 8fa189f19d0261ca67ae763ed3e217ef77013aac..9fc55d9be7a5868aee937fd0f3c0f8a065ab21a3 100644 (file)
@@ -43,7 +43,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 29,
+   "execution_count": 4,
    "metadata": {},
    "outputs": [],
    "source": [
   },
   {
    "cell_type": "code",
-   "execution_count": 66,
+   "execution_count": 10,
    "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "text/plain": [
-       "(((4, 3, 2, 1, 0), False, False), -7905.851738828606)"
-      ]
-     },
-     "execution_count": 66,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "outputs": [],
    "source": [
-    "rcpb = keyword_decipher(scb, 'tovarishch', KeywordWrapAlphabet.from_last)\n",
+    "spb = keyword_decipher(scb, 'tovarishch', KeywordWrapAlphabet.from_last)\n",
     "trs = list(itertools.permutations(range(5)))\n",
     "column_transposition_break_mp(rcpb, translist=trs, fitness=Ptrigrams)"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 73,
+   "execution_count": 11,
    "metadata": {},
    "outputs": [
     {
        "'vot ira chs oih aru neg ist htn sue vah oce lcn edu htd rie vni tse agi oit asn hdn eva ted mre eni htd tta reh sie dni dee asa tob rue row nik nig eht aeh otr htf ace tip ila sts cap gae cne esy ruc yti eht her tsa hgi net bde ttu yeh vah ebe une ban tel ido ocs rev ohw iti hts ita ows ikr tgn nuo red nim hte rie ffe tro ots loc ino ses cap one eno tni keh obg rgr siu awa oer naf oby wyd kro gni rid tce fyl uro hws owo dlu cro luo ahd cev rra dei tuo eht aes att skc ruf eht omr ter reh ksi afo sen lac ita lno dae gni aot oll wtu mra nae hts bta zer enh owv dlu ven cre nuo net cna roe tua roh ezi cus mah ssi noi eve fin hew tda aeh ess ist lpn eca cot rra tiy tuo eht mem yro tfo ceh fno nor tat noi evo htr ime iss bel esa kni abu its bll nru nas htd ope iss lib yti nfo lcu rae nna ihi tal noi tsi soo ort tgn ujo its tyf sih ros fot tca noi dni dee eht lop bti oru sah ted mre eni htd tta reh eca sot cap sie teb ret uof thg nni rae rae oht ibr hwt ere ruo nwo cet onh gol ahy las aer pyd vor ide est tfl ebo pus ire tro feh sri ast let til nae htd ife tsr nam den aps fec gil sth rew cae moc ilp ehs ybd ruo reh seo bta kia uno uor mar ire nac moc dar mse hya eva oht hgu sut aew hwk wne ome dev ruo nul ora ibr ret eot usn ter seh efa oyt htf rie rif lts anu alr idn bgn ttu sih saw ena itn ler tsy tar ige omc iev etn edn otd iub cdl fno edi ecn teb eew uon wtr ano oit wsn tah liw htl dye ono htw tta tah eht rif lts anu alr idn hgn bsa nee cca pmo sil deh rom ale idn sgn woh nam omy rno kco acs htn pye sso lbi eny ade wdn tah liw til soc oft htr tme rbo gni eht ohm eem rev imy iss tno yeh ual hcn sir csk ata rts hpo fci lia eru dna won sti mee hts ota oen htf rie nwo wsi kro gni eot usn ter teh ato uhl lim tai noi tfo ceh ipa lat tsi sys met aem hwn eli ruo aog asl ber tte mre bte tsy vir gni lot rae rfn tmo aeh rem aci csn poo are nit hwg ere mew tsu eot usn ter tah wew wni reh ewe nac san daa nim tsi tar sro vah lae aer myd eda evo utr ser uot ocs ecn inr jgn nio xet olp tar noi dna ruo alp sin bot liu nod eht yrd ned alb nog var avo erg eme itn ewf nac ooc idr tan jae nio imt iss tno sih ohs dlu vig sue cca sse sot emo tfo aeh rem aci etn nhc aci nal rtd nia gni tam ire sla ihw oel oru rnw kco ste tsy sme era raf rom ose ihp its tac tde nah eht sri eht rri ile cna noe eht iks oll htf rie tsa nor tua ems sna aht htt hye eva ael enr afd omr aer uob htt ile tim fos muh ena udn nar aec pdn fre mro cna hte wna ahe bev nee lba ote fos ira iwt tll eka mos ite tem voo cre emo eht ema cir dna tsi sur fot ruo ats aet idn ast neg eic ubs sat nol sag eht ody ton leb vei hte wta rae ebe nih htd ere nec ast tob ega tta pme tst neh hti kni wew lli aeb elb aot ihc eve iht ogs al'"
       ]
      },
-     "execution_count": 73,
+     "execution_count": 11,
      "metadata": {},
      "output_type": "execute_result"
     }
    ],
    "source": [
-    "wcat(chunks(rcpb, 3))"
+    "wcat(chunks(spb, 3))"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 71,
+   "execution_count": 12,
    "metadata": {},
    "outputs": [
     {
       "learned far more about the limits of human endurance and performance than we have be enable to so\n",
       "far it will take sometime to overcome the american distrust of our state and its agencies but as\n",
       "long as they do not believe that we are behind the recent sabotage attempts then i think we will be\n",
-      "able to achieve this gola\n"
+      "able to achieve this goal\n"
      ]
     }
    ],
    "source": [
-    "print(lcat(tpack(segment(cat(cat(reversed(c)) for c in chunks(rcpb, 3))))))"
+    "print(lcat(tpack(segment(cat(cat(reversed(c)) if len(c) == 3 else c for c in chunks(spb, 3))))))"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 72,
+   "execution_count": 14,
    "metadata": {},
    "outputs": [
     {
        "2469"
       ]
      },
-     "execution_count": 72,
+     "execution_count": 14,
      "metadata": {},
      "output_type": "execute_result"
     }
    ],
    "source": [
-    "open(plaintext_b_filename, 'w').write(lcat(tpack(segment(cat(cat(reversed(c)) \n",
-    "                                                             for c in chunks(rcpb, 3))))))"
+    "open(plaintext_b_filename, 'w').write(lcat(tpack(segment(cat(cat(reversed(c)) if len(c) == 3 else c \n",
+    "                                                             for c in chunks(spb, 3))))))"
    ]
   },
   {
index da10c30b0ccc97b139b79aebb3cba82257ff365b..a0f11890fb2dce5970b0ff3108d5389beb318a32 100644 (file)
@@ -23,4 +23,4 @@ sophisticated than theirs their reliance on the skill of their astronauts means
 learned far more about the limits of human endurance and performance than we have be enable to so
 far it will take sometime to overcome the american distrust of our state and its agencies but as
 long as they do not believe that we are behind the recent sabotage attempts then i think we will be
-able to achieve this gola
\ No newline at end of file
+able to achieve this goal
\ No newline at end of file