Home Page Hebern's machines Home Page Hebern 1 rotor Home Page Cryptanalysis, Home Page
|
IntroductionDonald A. Dawson invented a method that makes it possible to find the plain text of a message encrypted by a Hebern 1 rotor cipher machine. It is a statistical method. The methodThe heart of the method is based on the fact that each time the rotor moves forward, the wiring used to encrypt a letter is the same if we encrypt the next plain letter (in alphabetic order) to the one used previously. In the case where the only permutation carried out is the rotor, the shift carried out by the rotor is identical for each letter of the alphabet encrypted in the order: ABC..Z, or in the reverse order: ZYXWV...A , depending on whether the rotor advances clockwise or trigonometrically. In the case where the Lampboard permutation is different from the identity permutation (ABC...Z), the same wiring is used if the letters are encrypted in the order of the Lampboard (or the reverse order). Due to the fact that the method is based on the decryption of a message, the order of the permutations is reversed: we first proceed to the reverse permutation of the rotor and then to the reverse permutation of the lampboard (which therefore plays the role of the keyboard). Remarks:
An exampleNote: this example is largely inspired by the example given by Dawson in his book on page 100 (and taken up by Lanaki). Consider the following cryptogram: C:\H1_TOOlS> python groupe.py < MSGS\p100.cry XFSDO XIZYH SMDNJ NJILA FINJL SSEOY OPUZS LEPMT HDROS QFONJ LWRZY TKIKQ LVQFK KVLEJ FDHIK IKROK YRDZT IVKAI PJRGY EATRT KITYA JPYLB TENHW CDESC LHXWT RIBJP ZDSJU DTBZX FFRHT WTODD FIOAT ZLWYU OEBLN SHRHH TPTJA ETDOZ QGMQP EAYGC GHPTI JUDKW DMBTU WVULM LJSIG LNNWA JHBLE OEMTV AEVDX KTIUI WZWVM XMPQP ZPOXH LUNQL XGGCZ YWZNS LXYAH LLODD TDXCN JQHZL PIJQN VRZPJ HPZPO XHLUZ VXCKF LPIEZ GZWCO GRHTE OXTDD GSNLW TJUBQ QWSQW UYOPZ POXHL UZVXL LQBLU APQNQ XPENH PSRXT DDGUS YSPYO TNZTS BIPJH OZFKM WOOBZ CXOMC JNWZS QFXIH VXPQL WYIEA NLZXQ CXXND WYNPO PXZBW BAQTX NFCDO WSSNP PTEEW JHZYR WZXIT PUSZX HPCUD TGUGT RONUV NOFKJ SXBNW XUYIS IGFVB CFIUB NJOVB SRAIG GXFSB RLZUE THREE VWVYO VJRUC JFXXX LPHZL NSQXU KELTJ AGKOY USCXX PYOWG TGGLM BIHTE ZLATY DGJJR OWHPY ZDYUC AUBPP ZARKF ZDHSS SKYIS CTUVF NIMET YVYGX HJAIN SYXHI UDTYV ZWFKQ VJHZO MTVDH SSSKY ISCTL NSQXI ETPKW KYFXX MVAGL TEZDK SOQFX EUEDT IAQVR TDZPG LTTOB NDGPN APUUB ZOZSF CMGGN LLSEP HNDAQ EXWMQ STEAB FXKAI SPOQG LNNPY SWFNU NAWDM WHIAE ISXHL PVPLP WHNDJ UODMJ OQHOO CGMOQ TBRLZ DVKWC DUHPZ SRZYO OGUSG LTQIH OLVNB MHORL RWRCF YPHQJ DJTDU DTGYZ VXDHT LUWFT FHRDB SCKGM ZHZAL MAWJB XXEQD ATDMZ NSYJT RKILL VTTDE IHLUW ZEFQB AFZCR FGWHJ SBKQH OARGB OULWV AJTXU XMCBQ TMLUT IOBPN HZALW VNGQC UUEZP QKSBQ EXMRP LWYGA URAAS NODYP IVIPZ FEVJO KYRTR IFIID ISSXG GBBTB PNYMD XHHMI VDRRW AVZXU GVHXW ZEHGX PKOAR GRCYN AUSSR HXDRN HZEHS XIKOA ZUAGT LRGQK RXDCW HGQBF YAWKT NGNRE TOXZV XLEAD OZTBL HRWSI RPIZA GCXAS GMTXG CBAZA BQTDC QVJAS RJJJM USZXF LDUHT SENIX UIRWU EOQTL MHTFL EQBLE ILLSR IYTHZ XINYT TUGQL ZXEZU PAZXV CIOUT YRHKD TDOVW JMTSO XHAPY UQAWP XTZOV DJPIA NASGM GBLTU PRWXO NBDKN EUEYA EZJRX QYRPJ SFUAC SOH Step One: Determining the Number of AlphabetsWe can wonder whether our cryptogram corresponds to a simple substitution or not. Note: A more accurate statistical measure than IC, is Phi text: \[ \phi = \sum_{i=A}^{i=Z} f_i(f_i - 1) \] Note: f() represents the frequency of a letter. C:\H1_TOOlS> python phi.py File name ? MSGS\p100.cry A 56 , B 42 , C 33 , D 60 , E 50 , F 37 , G 52 , H 63 , I 57 , J 46 , K 36 , L 67 , M 33 , N 54 , O 62 , P 61 , Q 47 , R 52 , S 66 , T 80 , U 58 , V 41 , W 52 , X 72 , Y 48 , Z 68 , Letters: 1393 Phi values: Observed = 76988 Random = 74653 Non-random = 132631 As we can see, the cryptogram does not correspond to a simple substitution. Next question, assuming we have a substitution type cipher (like Vigenère), how many alphabets are used? C:\H1_TOOLS> python num_alpha.py MSGS\p100.cry 30 Number of letters: 1393 Columns Phi E(Phi_r) E(Phi_p) =====> 1 76988.0 74653.7 132437.5 =====> 2 20011.0 18663.4 33109.4 =====> 3 8510.0 8294.9 14715.3 =====> 4 5049.5 4665.9 8277.3 =====> 5 3026.0 2986.1 5297.5 =====> 6 2193.7 2073.7 3678.8 =====> 7 1560.6 1523.5 2702.8 =====> 8 1242.2 1166.5 2069.3 =====> 9 938.7 921.7 1635.0 =====>10 779.8 746.5 1324.4 =====>11 632.7 617.0 1094.5 =====>12 558.7 518.4 919.7 =====>13 592.5 441.7 783.7 =====>14 403.3 380.9 675.7 =====>15 336.4 331.8 588.6 =====>16 298.1 291.6 517.3 =====>17 256.8 258.3 458.3 =====>18 238.4 230.4 408.8 =====>19 201.7 206.8 366.9 =====>20 192.8 186.6 331.1 =====>21 175.5 169.3 300.3 =====>22 164.8 154.2 273.6 =====>23 139.7 141.1 250.4 =====>24 140.9 129.6 229.9 =====>25 115.4 119.4 211.9 =====>26 204.9 110.4 195.9 =====>27 104.3 102.4 181.7 =====>28 98.9 95.2 168.9 =====>29 85.9 88.8 157.5 =====>30 87.3 82.9 147.2Note: (E(Phi_r): Expected value for Phi of a random text, E(Phi_p): Expected value for Phi of a text in English. The maximum PHI value is for 26 alphabets, which is compatible with encryption with the Hebern machine. Step Two: The Frequency TableNext, we create the frequency table. The key (rotor position) is given on the ordinate, the encrypted letter is on the abscissa. Each diagonal corresponds to the letter frequency of the Lampboard permutation. For example, here are the frequencies of the first diagonal: 1 0 0 3 1 0 0 0 0 4 3 8 0 3 7 2 7 1 2 0 1 1 2 0 7 1 Here is the use of my dawson.py program (inspired by Dawson's rotorana.bas program). In the following we calculate the frequencies of the different diagonals and display a diagonal. C:\H1_TOOlS> python dawson.py 1 - Read the cryptogram from a file 2 - Print the cryptogram 3 - Choose the Reverse mode (Standard mode by default) 4 - Create matrix and diagonals 5 - Print matrix 6 - Print diagonals 7 - Print phi values of diagonals 8 - Add an alphabet (the first will be the base) 9 - Calculate PHI for remaining alphabets A - Print combined alphabet B - Constructing the Reduction Tableau C - Combine all alphabets D - Match two diagonals E - Reset the combined alphabet F - Reduction to a Monoalphabet Ciphertext Choice (return: print menu, Q: quit) ? 1 File name ? MSGS\p100.cry Choice (return: print menu, Q: quit) ? 2 X F S D O X I Z Y H S M D N J N J I L A F I N J L S S E O Y O P U Z S L E P M T H D R O S Q F O N J L W ... M T S O X H A P Y U Q A W P X T Z O V D J P I A N A S G M G B L T U P R W X O N B D K N E U E Y A E Z J R X Q Y R P J S F U A C S O H Cryptogram length: 1393 Choice (return: print menu, Q: quit) ? 4 Create Matrix and Diagonals... Choice (return: print menu, Q: quit) ? 5 Print Matrix ... A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 00 -- 1 0 3 2 0 0 3 0 0 0 0 7 2 0 3 1 1 5 5 1 2 0 0 12 3 3 01 -- 0 0 0 2 3 3 2 4 0 3 6 5 1 0 4 0 2 1 1 1 3 0 2 10 0 1 02 -- 1 0 0 1 2 2 5 1 0 0 0 3 3 0 1 5 5 0 5 8 0 0 2 2 7 1 03 -- 0 4 7 5 3 0 4 1 5 3 0 3 1 0 1 2 1 2 1 2 1 1 0 0 5 2 04 -- 1 4 0 1 0 0 0 1 2 1 2 4 0 0 7 6 0 4 5 0 8 1 2 2 0 3 05 -- 1 4 2 5 2 0 0 8 7 0 0 3 0 4 0 4 2 0 0 1 1 1 1 3 3 2 06 -- 3 1 0 0 1 0 5 1 3 3 3 2 0 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2 3 3 0 3 2 6 0 0 5 1 1 0 0 1 2 : 51 15 -- 3 3 0 5 0 3 2 0 1 3 0 4 1 0 4 1 0 0 1 1 0 1 3 1 3 9 : 49 16 -- 1 1 0 0 3 5 1 7 0 0 3 3 0 0 1 0 1 1 8 0 6 4 3 7 0 4 : 59 17 -- 1 2 1 0 5 0 0 2 0 0 0 2 0 0 1 5 2 5 12 4 4 0 0 0 2 3 : 51 18 -- 8 0 0 5 2 0 0 1 1 0 0 7 0 4 7 2 5 1 5 0 2 1 1 3 3 1 : 59 19 -- 5 1 0 0 0 0 1 2 6 0 3 5 1 5 0 6 1 0 1 1 1 7 1 5 3 0 : 55 20 -- 0 2 0 1 4 0 0 6 5 0 0 1 0 0 1 4 0 2 5 1 2 0 1 0 1 1 : 37 21 -- 0 1 2 4 4 0 2 10 4 5 0 2 1 7 0 1 2 4 1 8 3 0 2 0 0 0 : 63 22 -- 9 0 1 6 2 1 1 3 0 4 2 0 1 5 1 6 1 0 5 2 0 0 0 4 0 5 : 59 23 -- 7 1 1 0 3 3 1 2 0 1 5 0 4 4 0 2 4 0 0 0 1 0 2 12 1 3 : 57 24 -- 0 3 0 6 1 0 2 2 1 2 1 0 4 0 0 1 1 0 0 1 8 1 2 10 3 5 : 54 25 -- 2 1 3 5 0 11 3 0 4 2 0 0 1 1 0 1 5 0 5 13 1 1 0 2 0 3 : 64 Choice (return: print menu, Q: quit) ? A Enter the number of alphabet or return for combined alphabet ? 0 Number of diagonal: 0 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 0 0 3 1 0 0 0 0 4 3 8 0 3 7 2 7 1 2 1 1 1 2 0 7 1 Letters: 55 Phi values: Observed = 218 Random = 114 No-random = 203 Choice (return: print menu, Q: quit) ? Step three: Matching the Diagonal AlphabetsThe next step is to merge the different diagonals to ultimately obtain a single alphabet and therefore a ciphertext based on a simple substitution. To do this, you must determine one of the "basic cipher-text sequence" which corresponds to the encryption of a clear letter for each external key. Choice (return: print menu, Q: quit) ? 7 Print PHI of each diagonal... Row #_of_letters Actual_phi random no-random 0 55 218 114 203 1 53 192 106 188 2 41 74 63 112 3 56 196 119 210 4 52 138 102 181 5 53 220 106 188 6 76 318 219 389 7 46 150 80 141 8 56 294 119 210 9 51 188 98 174 10 37 78 51 91 11 51 164 98 174 12 50 166 94 167 13 58 308 127 226 14 51 130 98 174 15 49 154 91 161 16 59 238 132 234 17 51 232 98 174 18 59 230 132 234 19 55 196 114 203 20 37 100 51 91 21 63 272 150 267 22 59 228 132 234 23 57 254 123 218 24 54 228 110 195 25 64 362 155 275 You must choose a reference diagonal. It is called "alphabet base". We choose the diagonal which offers the greatest Phi value, in the following case, we take the alphabet number 25 which has the value 362. Choice (return: print menu, Q: quit) ? 8 Combine another alphabet to current combined alphabets... WARNING! You are ready to add the first alphabet (Base) its shift will be 'A'. Which alphabet to combine (enter to exit)?25 ... Then the next step is to combine the other alphabets. I can do it automatically (cf. previous problem) or alphabet by alphabet. This manual approach allows each step to choose the best alphabet and the best offset from the base alphabet and thus to accumulate more reliable statistics. In the example, alphabet 6 gives the highest phi value (318) whose value is median between the value for a random distribution and corresponds to English: E(Phi random) = 0.0385 x 76 x 75 = 219 E(Phi english)= 0.0683 x 76 x 75 = 389Instead of adding this alphabet, we prefer to add alphabet 8 whose value of Phi (294) is closer to the expected value (210) than that corresponds to chance (119). We can study alphabets 6 and 8 to know which alphabet to add first. Choice (return: print menu, Q: quit) ? D Matching two alphabets ... Enter stationary alphabet (-1 for combined):-1 Which alphabet to match:8 A: 126,B: 170,C: 100,D: 125,E: 351,F: 135,G: 131,H: 199,I: 107,J: 81,K: 136,L: 86,M: 48,N: 126,O: 165,P: 130,Q: 131,R: 182,S: 195,T: 148,U: 189,V: 114,W: 103 ,X: 99,Y: 154,Z: 53, Random chi = 137 Non-random chi= 245 Consequently we combine the alphabet 8 with a shift E (value which gives the strongest Phi value). Choice (return: print menu, Q: quit) ? 8 Combine another alphabet to current combined alphabets... Which alphabet to combine (enter to exit)?8 Which letter [shift]?E ----> O: Old combined, A: Alphabet to combine, N: New combined A B C D E F G H I J K L M N O P Q R S T U V W X Y Z O 2 1 3 5 0 11 3 0 4 2 0 0 1 1 0 1 5 0 5 13 1 1 0 2 0 3 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D A 0 0 5 4 0 5 1 0 4 1 0 0 0 0 0 2 3 0 3 14 2 3 1 3 0 5 N 2 1 8 9 0 16 4 0 8 3 0 0 1 1 0 3 8 0 8 27 3 4 1 5 0 8 We recalculate the Phi values. Choice (return: print menu, Q: quit) ? 9 Alphabet Best_letter_match observed_chi random no-random 0 V 449 254 451 1 Z 507 244 435 2 U 331 189 336 3 Q 461 258 459 4 W 380 240 426 5 J 566 244 435 6 G 656 351 623 7 B 431 212 377 9 Y 445 235 418 10 V 362 170 303 11 S 463 235 418 12 O 467 231 410 13 D 560 267 476 14 L 415 235 418 15 G 508 226 402 16 C 503 272 484 17 Z 581 235 418 18 V 575 272 484 19 S 475 254 451 20 Z 356 170 303 21 O 638 291 517 22 K 522 272 484 23 H 511 263 467 24 E 550 249 443 alphabet: ........E................A Current hypothesis: VZUQWJGBEYVSODLGCZVSZOKHEA Historic: [25, 8] We see that for alphabet 6, there is no longer any ambiguity. The maximum Phi value corresponds to English. We add the alphabet and then display the Phi value for the remaining alphabets.
Choice (return: print menu, Q: quit) ? 8 Combine another alphabet to current combined alphabets... Which alphabet to combine (enter to exit)?6 Which letter [shift]?G ----> O: Old combined, A: Alphabet to combine, N: New combined A B C D E F G H I J K L M N O P Q R S T U V W X Y O 2 1 8 9 0 16 4 0 8 3 0 0 1 1 0 3 8 0 8 27 3 4 1 5 0 G H I J K L M N O P Q R S T U V W X Y Z A B C D E A 3 0 3 3 3 5 0 0 8 3 0 0 1 2 4 1 7 1 5 10 3 4 0 5 2 N 5 1 11 12 3 21 4 0 16 6 0 0 2 3 4 4 15 1 13 37 6 8 1 10 2 Choice (return: print menu, Q: quit) ? 9 Alphabet Best_letter_match observed_chi random no-random 0 V 717 415 737 1 Z 788 399 710 2 U 519 309 549 3 Q 725 422 750 4 N 561 392 697 5 J 850 399 710 7 B 667 347 616 9 Y 707 384 683 10 V 562 279 496 11 S 730 384 683 12 O 722 377 670 13 D 870 437 777 14 L 655 384 683 15 G 767 369 656 16 C 792 445 790 17 Z 859 384 683 18 V 884 445 790 19 S 741 415 737 20 Z 560 279 496 21 O 932 475 844 22 K 803 445 790 23 H 788 430 764 24 E 841 407 723 alphabet: ......G.E................A Current hypothesis: VZUQNJGBEYVSODLGCZVSZOKHEA Historic: [25, 8, 6] It looks like the next alphabet to be added is the number 4. On the other hand, the shift is not obvious if we calculate all the possible values. The values for N and W are very close (561 and 556). Choice (return: print menu, Q: quit) ? D Matching two alphabets ... Enter stationary alphabet (-1 for combined):-1 Which alphabet to match:4 A: 343,B: 331,C: 467,D: 470,E: 331,F: 265,G: 415,H: 403,I: 414,J: 309,K: 453,L: 310,M: 367,N: 561,O: 436,P: 345,Q: 479,R: 366,S: 400,T: 371,U: 341,V: 272,W: 556 ,X: 412,Y: 350,Z: 425, Random chi = 392 Non-random chi= 697 We wait a bit before adding this alphabet. We add alphabet 2 in its place. Then, for alphabet 4, shift N stands out: Choice (return: print menu, Q: quit) ? D Matching two alphabets ... Enter stationary alphabet (-1 for combined):-1 Which alphabet to match:4 A: 409,B: 411,C: 554,D: 550,E: 403,F: 332,G: 501,H: 492,I: 492,J: 387,K: 530,L: 382,M: 455,N: 687,O: 521,P: 413,Q: 568,R: 443,S: 490,T: 459,U: 419,V: 350,W: 638 ,X: 495,Y: 430,Z: 513, Random chi = 474 Non-random chi= 842 You can also add other alphabets automatically: Choice (return: print menu, Q: quit) ? C Combine all alphabets after enter decalages... WARNING: all values about combined alphabet are reset Decalage Alphabet? (return to exit, HYPO to use hypothesis)HYPO OK 1393 Step Four: Build the Reduction TableThe next step is to build the "reduction table". In this table, the first column corresponds to our hypothesis (VZUQN...A). This is one of the "Basic cipher-text sequences". The diagonals correspond to the alphabet (ABC...Z). Choice (return: print menu, Q: quit) ? A Enter the number of alphabet or return for combined alphabet ? alphabet: VZUQNJGBEYVSODLGCZVSZOKHEA Nb letters: 1393 Hypothesis: VZUQNJGBEYVSODLGCZVSZOKHEA Historic: [25, 8, 6, 2] A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 31 14 45 93 28121 27 0107 42 1 1 17 18 31 39155 11 94194 57 96 7 71 23 70 Letters: 1393 Phi values: Observed = 136504 Random = 74653 No-random = 132631 Choice (return: print menu, Q: quit) ? B The Reduction Tableau ... A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 V A W T R O M I M H F D A Q Z V S Q N L T J G E C Z 1 Z V S Q N L H L G E C Z P Y U R P M K S I F D B Y U 2 U R P M K G K F D B Y O X T Q O L J R H E C A X T Y 3 Q O L J F J E C A X N W S P N K I Q G D B Z W S X T 4 N K I E I D B Z W M V R O M J H P F C A Y V R W S P 5 J H D H C A Y V L U Q N L I G O E B Z X U Q V R O M 6 G C G B Z X U K T P M K H F N D A Y W T P U Q N L I 7 B F A Y W T J S O L J G E M C Z X V S O T P M K H F 8 E Z X V S I R N K I F D L B Y W U R N S O L J G E A 9 Y W U R H Q M J H E C K A X V T Q M R N K I F D Z D 10 V T Q G P L I G D B J Z W U S P L Q M J H E C Y C X 11 S P F O K H F C A I Y V T R O K P L I G D B X B W U 12 O E N J G E B Z H X U S Q N J O K H F C A W A V T R 13 D M I F D A Y G W T R P M I N J G E B Z V Z U S Q N 14 L H E C Z X F V S Q O L H M I F D A Y U Y T R P M C 15 G D B Y W E U R P N K G L H E C Z X T X S Q O L B K 16 C A X V D T Q O M J F K G D B Y W S W R P N K A J F 17 Z W U C S P N L I E J F C A X V R V Q O M J Z I E B 18 V T B R O M K H D I E B Z W U Q U P N L I Y H D A Y 19 S A Q N L J G C H D A Y V T P T O M K H X G C Z X U 20 Z P M K I F B G C Z X U S O S N L J G W F B Y W T R 21 O L J H E A F B Y W T R N R M K I F V E A X V S Q Y 22 K I G D Z E A X V S Q M Q L J H E U D Z W U R P X N 23 H F C Y D Z W U R P L P K I G D T C Y V T Q O W M J 24 E B X C Y V T Q O K O J H F C S B X U S P N V L I G 25 A W B X U S P N J N I G E B R A W T R O M U K H F D Step five: Reduction to a Monoalphabet CipertextWe now have a single alphabet. We can calculate the Phi value to measure the quality of our result. We have obtained a distribution matches English if Phi is close to the "no-random" value. Choice (return: print menu, Q: quit) ? A Enter the number of alphabet or return for combined alphabet ? alphabet: VZUQNJGBEYVSODLGCZVSZOKHEA Nb letters: 1393 Hypothesis: VZUQNJGBEYVSODLGCZVSZOKHEA Historic: [25, 8, 6, 2] A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 31 14 45 93 28121 27 0107 42 1 1 17 18 31 39155 11 94194 57 96 7 71 23 70 Letters: 1393 Phi values: Observed = 136504 Random = 74653 No-random = 132631 We save the “mono-substitution” vision in a file. Choice (return: print menu, Q: quit) ? F Nb of letters; 1393 Decalages: [21, 25, 20, 16, 13, 9, 6, 1, 4, 24, 21, 18, 14, 3, 11, 6 , 2, 25, 21, 18, 25, 14, 10, 7, 4, 0] Q Z T X T D X T S F Y F X S C T J I V I F S P D N T X V M Z T Q Z T X M T U I N T I Q F X S F Q P D N I S E D J Z F I J T I V D A D X Q F O Y T I S E Z G P D S D S C M T C F S F Q Q Z I S N Q F F Z I E Z U R F O Q Z F V T M Z F Q Z X F M D M D R Q Q D V X I E Z Q T V Q Z T X Y R Z D B I S E V F P T F S T T U V T P D N T G A Q Z T I X P I S C V O F X Q Z T P F X Y R Q D N I S E V F P G J Z Q I P T P D N I S E D C T J I V I F S Q Z D Q I V I V Q F F U D Q T Q F D J Q S F Q Q F C T J I C T I V D C T J I V I F S S F Q Q F C T J I C T Z T X T D X T Q M F P T Q Z F C V F O D A A X F D J Z I S E Q Z T C T J I V I F S P D N I S E A X F J T V V Q Z T O I X V Q I V Q Z D Q Q Z T P F V Q V G J J T V V O G U C T J I V I F S P D N T X V O F U U F M D V T Q F O X G U T V Q Z D Q Z T U A Q Z T P V T U T J Q Q Z T Y T V Q D U Q T X S D Q I B T G S C T X Q Z T J I X J G P V Q D S J T V Q Z T V T Y D V I J X G U T V F O C T J I V I F S P D N I S E I S B F U B T V V I W V Q T A V O I X V Q V Q D Q T Q Z T D A A D X T S Q A X F Y U T P F X V I Q G D Q I F S R F G O D J T V T J F S C E D Q Z T X Q Z T O D J Q V Q Z I X C F X E D S I K T D S C I S Q T X A X T Q Q Z T V T O D J Q V O F G X Q Z V Q D Q T Q Z T X S Y V A X F Y U T P F X V I Q G D Q I F S I S M X I Q I S E O I O Q Z C T B T U F A D U Q T X S D Q I B T V F U G Q I F S V D S C V I W Q Z V T U T J Q Q Z T P F V Q D A A X F A X I D Q T D U Q T X S D Q I B T Q Z T V T J F S C P T Q Z F C F O D A A X F D J Z I S E Q Z T C T J I V I F S P D N I S E A X F J T V V I V L G I Q T Q Z T F A A F V I Q T Z T X T D X T V I W Q T T S M D R V Q F C F C E T C T J I V I F S V F S T Q D N T O U I E Z Q I S Q F C T Q D I U V Q M F J F G S V T U I S O I S I Q T C T U D R F O D J Q I F S Q Z X T T C T U T E D Q T Q Z T A X F Y U T P Q F D J F P P I Q Q T T O F G X U F F N O F X Q Z T D S V M T X I S Q Z T Y F F N O I B T I S C G J T Q Z T Y F V V Q F J F P P I Q Z I P V T U O F S Z F M Q F Z D S C U T Q Z T A X F Y U T P V I W E I B T D S D S V M T X I S C F G Y U T Q D U N V T B T S C T U T E D Q T Q Z T A X F Y U T P Q F D V G Y F X C I S D Q T T I E Z Q I S C I J D Q T Q Z D Q D U U A X F Y U T P V P G V Q Y T J F S V I C T X T C I S V T X I D U F X C T X S I S T Z D B T D V Q G C R P D C T Q F E T Q D U U Q Z T O D J Q V Q T S D X X D S E T Q F Y T J D U U T C F G Q F O Q F M S T U T B T S J D U U I S D S T W A T X Q Q F P D N T V G X T M T X T F S V F U I C E X F G S C Q M T U B T C T S R Q Z D Q D S R A X F Y U T P T W I V Q V Q Z I X Q T T S Q D N T O U I E Z Q I S Q F I U U S T V V O F G X Q T T S Q D N T O U I E Z Q I S Q F Q Z T Y F Q Q U T O I O Q T T S V Q D Q T Q Z T A X F Y U T P Y T U F S E V I S V F P T F S T T U V T V A X F B I S J T V I W Q T T S V I P A U R A G Q F S F S T V Z D Q D S C E F Z F P T Do you want to save mono-alphabet ciphertext (return to exit, name of a file to save) ? MSGS\p100_mon.cry Plain saved ... Choice (return: print menu, Q: quit) ? Step six: Find the plain textAs the cryptogram is long, it is easy to decipher it by hand. For simplicity we use the Hill Climbing algorithm to solve the substitution. C:\H1_TOOLS>python hc_substi.py -c MSGS\p100_mon.cry -M BIG -m english 0 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 1 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 2 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 3 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 4 7.4940366834667165 THEDEADENOBODNMECISIONPAKEDSWHETHEDWERIKEITODNOTPA 5 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 6 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 7 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 8 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA 9 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMA Cles: DYJCTOEZIHNUPSFALXVQGBMWRK Score: 7.578662544189707 THEREARENOBORNDECISIONMAKERSWHETHERWELIKEITORNOTMAKINGACHOICEISAPARTOFBEINGHUMANANDWEDONOT THINKTOOHIGHLYOFTHOSEWHOTHROWAWAYTTASRIGHTESTHERBYHAVINGSOMEONEELSEMAKEUPTHEIRMINDSFORTHEM ORBYTAKINGSOMUCHTIMEMAKINGADECISIONTHATISISTOOLATETOACTNOTTODECIDEISADECISIONNOTTODECIDEHE REARETWOMETHODSOFAPPROACHINGTHEDECISIONMAKINGPROCESSTHEFIRSTISTHATTHEMOSTSUCCESSFULDECISIO NMAKERSFOLLOWASETOFRULESTHATHELPTHEMSELECTTHEBESTALTERNATIVEUNDERTHECIRCUMSTANCESTHESEBASI CRULESOFDECISIONMAKINGINVOLVESSIXSTEPSFIRSTSTATETHEAPPARENTPROBLEMORSITUATIONYOUFACESECOND GATHERTHEFACTSTHIRDORGANIZEANDINTERPRETTHESEFACTSFOURTHSTATETHERNBSPROBLEMORSITUATIONINWRI TINGFIFTHDEVELOPALTERNATIVESOLUTIONSANDSIXTHSELECTTHEMOSTAPPROPRIATEALTERNATIVETHESECONDME THODOFAPPROACHINGTHEDECISIONMAKINGPROCESSISQUITETHEOPPOSITEHEREARESIXTEENWAYSTODODGEDECISI ONSONETAKEFLIGHTINTODETAILSTWOCOUNSELINFINITEDELAYOFACTIONTHREEDELEGATETHEPROBLEMTOACOMMIT TEEFOURLOOKFORTHEANSWERINTHEBOOKFIVEINDUCETHEBOSSTOCOMMITHIMSELFONHOWTOHANDLETHEPROBLEMSIX GIVEANANSWERINDOUBLETALKSEVENDELEGATETHEPROBLEMTOASUBORDINATEEIGHTINDICATETHATALLPROBLEMSM USTBECONSIDEREDINSERIALORDERNINEHAVEASTUDYMADETOGETALLTHEFACTSTENARRANGETOBECALLEDOUTOFTOW NELEVENCALLINANEXPERTTOMAKESUREWEREONSOLIDGROUNDTWELVEDENYTHATANYPROBLEMEXISTSTHIRTEENTAKE FLIGHTINTOILLNESSFOURTEENTAKEFLIGHTINTOTHEBOTTLEFIFTEENSTATETHEPROBLEMBELONGSINSOMEONEELSE SPROVINCESIXTEENSIMPLYPUTONONESHATANDGOHOME Remarks:
References
Web Links
|