Hebern 1 rotor: The Dawson method


Home Page
Hebern's machines Home Page
Hebern 1 rotor Home Page
Cryptanalysis, Home Page

Introduction

Donald 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.

We describe the method and give a complete example in the following chapter

In the following example, we give a very simple example to solve a problem where only the rotor wiring is unknown.

An example

First step: calculate diagonals

C:\H1_TOOLS> python groupe.py < MSGS\gutemberg.cry
UJAES HSEIH HOZBM PGBGN IIPPE MAZYA RDRDT UWUTB GWZYH ITJQZ
BIUTV FJGTG VXPTD NNUWB GNXQJ QLZLX AZSVV TNTHF QYYBF KFURJ
HIRNB VOOYW TYWXJ JJKMR UBNTS QOYBL KTVWS DPXIV ISFGV WJBHA
ADZFB FFXAM AYZRZ FZPMP WINIQ OFMAX JWBVV HAWOG KHSPO BFNZF
HCWLJ VEKWQ TOVRM LNFZZ OCUXZ TFTBI PQPTW QVGCO KCJAZ JMEWI
SJLFR OYZSL MZXLA PTXDC BDVID QDXID CDSQF CHZAT GNSKZ WIMQS
WVJBN TSJGF CMOZY ARDRD TUWUT BMMDN SUFEM FSOFX VSGWW DOZSP
VOWMT PRANV VFBDB TKFJG TBQXR JFKBO NNIWF MUWAM RMCPS OJSCK
PRQPB FWXRC VBRQS SOTYD TYXPP YIMDP ERLPQ ZRVJE JDSAA TSRBF
QUUXV SVUZH IGWHJ NJTPK VBCCM SOMHO QPUHJ JIYCC GGSNQ TSFSF
SRZYS CXYKQ MEUTF JHJNS OZTKR ULXWG ARQGN GFNJV PJAWE DPANJ
QXIXN CUXIB DHQJO DCDKH PSICJ ODBSK ZAWUV IDQDN RNMJC NSIBD
ZJEWH XWCEC MNVAM ZROZD UQFRT DUTGT APZUG KJRFU TNVMF RGUVK
OAQZC CMSIC YNXOI MNIQH QQYWW HRWPG AGMSA LZKPB GFDZF TSVWJ
GOKWA DKRLI OJPKO MWHQN FYVCR QWLOS QFSRB FQUUX VSVUZ XIIJX
PWHNF OQLKH RMJTZ RXGRX FSQSS VMKNH HSNFS DKKAV LONBM ZJRPC
MOVJE LVJKL QXJCZ YKCJK DBLRF CGIOW VWFAC JAULD TTAYJ GFPGJ
INKZP ISITT ZJCGI DLTHG DIBMG JOMWQ NQNKB VOFYY IFWEE NUAGO
WYQEK IPWJW LZEJA FMJZW YNXBY TJMAO VBMTW MHOBJ AVNGW RIYXB
OUASQ EMDCC KXFKV BATTR ZGUXT QWQDX AISOH XHDWB CKGFZ BAZZZ
QEDQN HDTTD AQPCH ZSFBC LWMVI FWNYT ZFQUR OHMNT FIVLZ YXEOW
IXUYF GFNVM FRWXQ NLOVM SBSNW LIOIG MRSHI IGKZM MDVCS GYYAN
KUWXQ KYMWM SEMWW XZBLC KQCCR YYCXP URDIA WAAOJ QOMZN CCQGN
YXZKS JMRIX RINLZ OHFCD FGJBS AMSPW HCIBM EWZFB FCQXM BXZNF
SRSKU KIGIR YRFES CADPX SWOTP FJYFF IZZJI DDQMK QISEM ZFFWO
BHSVA DOZBF LETPD JZASY OJELM ZKGDD YFTUX JIGCI NILTX YNECN
QVTGY YHDAR AOYXK URHIF ECWEZ IXSSU EKRSC GAOYB PMWSF ZFJYU
JMUTK JTCJG XRENJ BJYZN VPXWT EBPTD CFGBL IJFWM TROMG JOUXM
RJEPW QUSSV ZYPHE JKRYF TYZAN EWGJW BVVKA PLIJJ PFMRF GFQQZ
RGMFA MKOAZ HVVMO WMGGR FPCEM NTXMD PWPGT KAHZU XHIOF BJFNT
SCROA QWKRI CLWYA KUKNZ TMWQJ BQZVM TBBDV ZZLZB QFQEH XGXUA
NNQEQ DMUEZ UCCKZ TIRLW LDYMW AFFDN TDVRA PWACJ KHMKU KYJNG
MWAXR ALBMV QTZKQ BAYYS ZKHOO BANBI NUFJP ZZKKO HKGIA FYTHF
YIUXR JRPZI OBJOU GVFSX PKOKZ FLKQF NZSUR MWRQK JWOOE YFXAY
IOICC YAXHE WKZBS IBGDP RBYXZ EPVQR FHFIN UCTHT JDBVV MRAMI
DFJYO DINDH AMFEZ VBIJF QFJGV FDCNV TSYTG FQIMM JBZLV UOZIK
RSAYA JIQQM WNTNT WNWSI XGQBJ XRIJA IDQQD XGGFQ FBYYS YFGKB
CVAJZ YONQK MMUNN YFEQW EPBVO ZREMF QGIKQ IQRGT LTRVJ UNMVO
SHBGI DUKAY JZWVN INURI GBCNL LOHXY RDLXZ ZQYAE JFQZN IXMSI
WDNLK SMKOG KNCKQ MTNHC FLYWV ZPOBL ACLRF DAOYQ UAZXI PZDPI
SQROV UYWSK ZWZZQ SKRXH IFXBC WWQVJ DBCDR NLCWJ IHUIU WDURJ
HBSPW QOODU SDZEP KOYBM MBOTT ENJUI ZVVMS GTXWC PROCW AJEQU
RQDYJ TFJNL KYJAL THVTN YUWHH ASJQG SIRWU JKGZR OZBNM BCANI
QHCQY DPRPA CMDWZ RAIZZ QMUHZ FSZQX PQLKK AQLKW HXIWX NLSYI
BUGTN DYWUS RJOMM BZRYC WYDGF UOZSW CMXUJ OTTYK QELDT ZHYJP
MUKMG ADOAG SRWSC JQESX OGHMQ MERNI VMFLW GUMLT HESHS RAIOP
ZMUZU ISZWW TFCKO ZQBKW LILCJ VQPUF NNAOC XRDPB UGOXS FJSZK
OJFKN ODMGN GWJUR YVJVV DUFYM CBJUR OFUDM SFWWM SIWDN GKRQM
THLFQ CWEJP GONDD RWKFC YFDXI CUHEF QKIIT HIFZD MZQYM ZXLVX
XSZKL VQCUX DXJTT QMVVY WAGZY WAYUI AJINW BGNFG WBCWN KLUVZ
TYRIF HEQJQ DXNIQ OTOKR QKUSQ UWESK ZUYJX ROFTG PWGOD FJLMZ
PGEUM SNTPZ VPBRX NIOCO YXMUM OOOSB JAKXW ELIUB SKGIT RWTRN
BIBJA ERIFV MYOBM WMMVM FKMZF MAOBJ JWZRZ XKPJC WIMEM CWYJD
BPPIB TRBQN WUZQM OQUMA QUVQY YSCLB OMRXI GTCBC IJWBN WLNCK
NJPPU WOGQX ERXIP PMPUB MTFOR CJJVK KIVZC GVYAU YCQMJ HWJDI
SEYYS GFGJL GFFXO OGPFC YFDNA TELWV EUWZS XSVTC UGUQV LERDM
FERVJ CFZQM TGCVV LLTHK QMKHM ZQMFJ PFRYV JVKKU FGQCZ FDEIH
JJIUC KPWUM OAVGA YYXQH JCGBA YJBGI SJOTM TACYJ QGSTX AXZOY
KMGJO EVWGU BTTZO DCERR LTHQJ MDBLJ OOZDX JKZLU CPSRJ UOFWN
CYMBQ NNHNZ DYUZO HVOQW ZRXHL GDBJR TFSOW IDDPZ BCAZR BSK

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 (or any 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\gutemberg.cry
Choice (return: print menu, Q: quit) ? 2

U J A E S H S E I H H O Z B M P G B G N I I P P E M
A Z Y A R D R D T U W U T B G W Z Y H I T J Q Z B I
...
L U C P S R J U O F W N C Y M B Q N N H N Z D Y U Z
O H V O Q W Z R X H L G D B J R T F S O W I D D P Z
B C A Z R B S K
Cryptogram length:  2998
Choice (return: print menu, Q: quit) ? 4
Create Matrix and Diagonals...

Step 2: merge the diagonals

In the following example, we combine the different diagonals. This operation is carried out automatically.

Note: The program allows you to make these amalgams in a manual manner. The following page shows details of this approach. It becomes obligatory if the cryptogram is not very long (less than 1000 characters).

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)?0
----> 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  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  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
A  3  3  5  5  0  0  4  3 13 12  1  0 11  5  9  8  0  3  0  2  0  8  2  2  6 15
N  3  3  5  5  0  0  4  3 13 12  1  0 11  5  9  8  0  3  0  2  0  8  2  2  6 15
Choice (return: print menu, Q: quit) ?

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 2998

Step 3: Reducing the cryptogram to a simple substitution

Choice (return: print menu, Q: quit) ? A
Enter the number of alphabet or return for combined alphabet ?
alphabet:  ANRZOKOARLXDKHCATINXKWTWEG
Nb letters:  2998
Hypothesis:  ANRZOKOARLXDKHCATINXKWTWEG
Historic:  [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
 88 74153202  8 13166 77198238 68  1198185241 99 30 60  3 52  0242 48 79108367
Letters:  2998
Phi values:
     Observed    =     570612
     Random      =     345922
     No-random   =     614574

Choice (return: print menu, Q: quit) ? F
Nb of letters;  2998 Decalages:  [0, 13, 17, 25, 14, 10, 14, 0, 17, 11, 23, 3, 
10, 7, 2, 0, 19, 8, 13, 23, 10, 22, 19, 22, 4, 6]

K M J E Z X O B P O Z I W Z M B N O C Z R J M F N J
A Z Y B V M V G G V I K J Z W T Z Y B V M V G G V I
K J Z O C D N Z W J J F D N A J M O C Z P N Z J A V
I T J I Z V I T R C Z M Z V O I J X J N O V I Y R D
O C V G H J N O I J M Z N O M D X O D J I N R C V O
...
I Y O C Z Y J H V D I J A V M I C Z D H N P X C H V
M Q Z G G J P N N O P Y D Z N D I M V O D J X D I V
O D J I V N O C
Do you want to save mono-alphabet ciphertext
(return to exit, name of a file to save) ? MSGS\gutemberg_mono.cry
Plain saved ...
Choice (return: print menu, Q: quit) ?

Step 4: reconstruct the plain text

Via the dawson.py program, we were able to reduce the original cryptogram to a simple substitution. In the case where the only permutation used is the rotor, the substitution alphabet is a simple shift of the ordinary alphabet (ABC...Z).

To find the solution (the clear text of the message), simply try the 25 possible offsets. We do the test on the first 26 letters.

0   K M J E Z X O B P O Z I W Z M B N O C Z R J M F N J
1   L N K F A Y P C Q P A J X A N C O P D A S K N G O K 
2   M O L G B Z Q D R Q B K Y B O D P Q E B T L O H P L
3   N P M H C A R E S R C L Z C P E Q R F C U M P I Q M
4   O Q N I D B S F T S D M A D Q F R S G D V N Q J R N
5   P R O J E C T G U T E N B E R G S T H E W O R K S O
6   Q S P K F B U H V U F O C F S H T U I F X P S L T P
7   ...

The 5th shift gives the solution: “PROJECT GUTENBERG…”.