Hebern 1 rotor: The Friedman method version 2


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

Introduction

In this page we will use the intervals statistical method version 2 of Friedman but for the Hebern machine 1 rotor.

The reader is referred to the following page for a complete description of this method: Interval Friedman's method v2.

A simplified example

In the following example, we present a simplified example of using the Friedman interval method version 2.

Here, we use a 1-rotor Hebern encryption machine, not a 5-rotors machine. On the other hand, the lampboard permutation is known and the keyboard and lampboard permutations are constant and equal to the identity (ABC...Z).

Step One: Creating the Ciphertext

Remarks:
  • The plain text comes from the Gutemberg project and corresponds to the first 4 chapters of The Hound of the Baskervilles.
  • The ciphertext is almost 40,000 characters long.
    Note: Due to the use of version 2 of the Friedman method we could have used a much shorter text (around 2,000 letters).
C:\H1_TOOLS> python hebern1_tui.py -R p17 < MSGS\baskerville.pln > MSGS\basker.cry

C:\H1_TOOLS> python groupe.py < MSGS\basker.cry  
QVOHC YAUQK EJXMC ZPIFC DDVGW PMZZO GHWKA GYJJQ QURXA SNZMZ
FHEZZ QQVSG UZZZQ LCITH IFNQM NSCUT SFJWT GWXZQ MXMMH WQERI
DBBPW TSBBC MIMCN CJZVF DZIAL VYEBP KZOFS RRYLT HWXBD JOXAO
RJKZS NKOAL ITYXW HEJPB DINIL SLJHI NNQMV UVKSK ZKZQF TETJK
GTXMS DENBT ZPRRI GDHDJ PRFVQ HDOZD HDXYB PVTGD MNLRI YVXUB
ZBGAO FRDSU VTKVG WXPIG DNLNQ MMYQP CKYYS PRJCV JGQKU KFOTQ
FFGXU NSJHM FZIXV MHTTY IZBJX KQMQN SPIJV JADRS YBDXN GQJIO
ISWFW ZKISO HBCZQ JABEU JVOVH YNGMH JSQZD MDXLD RKBKE NANZZ
BYTXY TZKXM IJVWP BOSEJ ITYXW FZBDK QHQNM IRDZF RZKRG BCBZW
MUGKD HLFGB GNCCC TBPMC AZSRH FHFUS HIDZN HVACB JUMPV UCLTV
...

Using the Friedman method: We use an interval of index 4

First, we use an interval of index 4. In the table generated for this interval, you must search for the box giving the highest value for each column. For example, if the box belonging to line G and in column B contains 108 (the highest value for column B), we can deduce that in the rotor wiring, the letters B and G are separated by 3 letters (B...G).

Here is the table for an interval of three letters (index 4):

C:\H1_TOOLS> python fried_new.py -I 4 < MSGS\baskerville.cry
    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: 73 51 76 38 61 46 80 72 43 39 54 47 66 41 43 66 66 61 47 88 59 54 54 45 39 47
B: 55 45 71 56 55 65 62 42 52 65 51 46 34 61 33 59 54 45 41 56100 60 72 45 75 38
C: 63 61 83 55 52 59 64115 58 66 64 55 53 65 44 59 59 41 43 68 56 46 64 64 68 64
D: 95 59 72 62 56 55 55 63 54 47 53 47 39 46 59 71 49 53 43 67 50 74 53 58 48 65
E: 45 43 65 35 69 55 63 46 40 56 66 58 75 60114 60 69 43 62 59 59 89 70 72 56 64
F: 49 51 70 66 45 58 48 43 87 75 67 54 62 52 48 49 54 46 61 53 53 43 45 60 57 52
G: 57108 43 59 51 59 48 69 46 63 54 55 63 54 50 53 58 54 49 46 69 66 58 78 43 39
H: 53 70 56 67 69 41 60 61 52 50 51 53 67 50 50 52 40 59 37 68 57 67 93 44 49 54
I: 80 54 49 58 52 58 57 39 62 65 91 49 63 55 47 47 46 58 54 53 52 59 66 59 66 60
J: 50 39 71 64 77 64 52 55 61 55 70 62 51 64 37 55 45 63 62 49 54 40 50 65 95 51
K: 60 57 37 46 83 52 44 49 58 79 68 53 62 41 49 60 45108 53 69 63 64 46 41 70 60
L: 71 47 57 88 65 55 51 57 63 51 53 57 34 60 63 53 63 50 66 54 45 36 48 61 61 59
M: 39 62 75 56 48 43 62 56 54109 82 68 61 49 59 45 52 89 52 54 68 53 40 43 62 42
N: 47 63 45 42 53 48 44 52 77 65 62 51 96 59 66 66 42 53 53 54 52 51 53 47 49 50
O: 42 54 55 77 51 64 45 54 61 52 57 75 59 47 76 62 64 64 47 53 51 55 41 57 59 56
P: 75 41116 68 63 54 55 51 55 67 46 50 52 39 65 48 62 46 65 83 58 56 39 45 44 52
Q: 55 54 50 65 42 48 58 56 45 40 56 60 49 59 44 62 55 46 60 52 42 57 60 51 60 91
R: 43 46 50 51 75 56 72 62 68 60 60 60 64 49 67 55 45 62 82 59 43 53 33 81 61 70
S: 38 62 66 46 60 42 60 53 49 43 50 56 72 51 53 65 69 51 56 46 38 47 24101 71 44
T: 35 68 69 56 42 53 95 63 75 55 44 54 65 59 54 45 43 66 60 64 47 71 73 47 44 63
U: 43 57 44 40 63 60 57 57 84 46 56 42 68104 43 55 41 54 53 43 67 63 52 44 57 59
V: 53 62 42 59 68 98 56 52 64 37 38 75 52 82 57 64 47 59 39 53 59 46 43 48 66 58
W: 54 52 52 57 53 58 61 45 44 65 56 56 52 51 60 52 43 58 48 61 61 83 56 37 44 47
X: 46 43 56 57 69 49 43 61 57 57 64 67 60 43 68 42109 63 50 57 48 50 57 83 56 60
Y: 54 48 52 73 97 62 46 52 51 55 53 45 54 46 68 61 51 70 76 49 58 54 52 68 69 52
Z: 82 39 68 52 74 46 53 45 39 39 51 73 50 54 61 89 46 65 55 52 43 40 64 71 46 64

We can deduce the following pairs (each couple of letters being separated by 3 letters):
BG, CP, AD, DL, EY, FV, GT, HC, JM, KI, NU, OE, QX, RK, UB, XS, YJ, ZQ

If we report these couples in relation to each other (when possible), we have pieces of the rotor wiring:


      H...C...P, A...D...L, O...E...Y, F...V, B...G...T
      Y...J...M, K...I, N...U...B, Z...Q...X...S
      R...K, Z...Q

We test another interval to reconstruct the sequence

The previous data is not sufficient, in addition, we must use an interval of 4 letters (index equal to 5)

C:\H1_TOOLS> python fried_new.py -I 5 < MSGS\baskerville.cry
    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: 62 53 58 49 52 98 60 63 61 39 61 61 61 62 36 52 36 63 47 47 74 65 31 58 72 35
B: 56 47 37 40 57 57 42 55 46 78 66 50 62 57 50 56 47 84 58 66 53 54 39 46 72 63
C: 50 54 73 44 69 68 80 63 73 45 67 38 75108 64 57 43 48 52 79 63 69 48 41 57 61
D: 46 66 92 68 59 58 58 46 46 68 53 55 60 47 63 57 48 58 54 47 58 95 46 52 41 52
E: 69 53106 58 63 73 68 73 71 71 47 52 52 47 52 73 55 49 57 68 59 61 64 57 43 52
F: 57 54 42 69 98 43 46 58 51 48 43 40 61 64 70 47 52 67 57 51 48 51 47 79 53 52
G: 55 49 55 52 54 43 59 60 82 75 89 52 64 60 64 41 39 57 47 51 52 64 51 63 66 47
H: 32 52 57 47 54 60 65 56 60 72 64 59100 55 49 52 42 57 50 56 50 53 43 81 49 55
I: 60 34 64 42 82 53 39 45 58 58 48 62 61 47107 51 69 62 53 62 44 67 55 73 47 56
J: 68 42 42 78 46 51 51 69 46 62 61 72 45 48 45 72 73 56 48 65 47 57 69 54 54 80
K: 41 43 44 83 62 72 48 61 48 50 60 83 53 44 70 67 75 75 53 66 46 49 44 67 60 53
L: 55 64 68 45 69 39 71 63 48 46 66 65 41 57 49 45 51 62 47 63 59 56 92 40 54 53
M: 43 49 69 70 63 36 47 58 54 53 61 60 65 55 63 52 99 64 38 62 60 42 62 74 66 58
N: 50 54 54 41 70 57 45 51 55 48 59 55 62 47 66 49 69 47 66 55 46 43 51 94 57 49
O: 52 58 69 64 35 59 59 85 55 51 54 51 46 65 40 55 58 48 46 63 53 39 72 57 85 59
P: 61 63 44 42 62 58 62 45 63 50 64 50 53 69 36 45 50 45 70 60105 63 56 55 67 57
Q: 68 60 63 52 49 41 94 65 51 50 36 56 53 54 60 50 46 62 54 61 37 56 67 37 46 49
R: 73 65 66 96 70 58 63 44 54 60 50 70 34 50 48 63 60 57 49 47 56 47 51 61 52 83
S: 95 68 68 61 59 49 37 69 42 36 61 43 42 42 61 66 39 48 56 49 44 68 48 38 57 67
T: 44 59 57 59 69 68 58 44 90 62 60 54 72 64 45 52 54 45 60 56 68 46 72 59 50 43
U: 43 38 59 50 67 47 68 40 60 52 55 64 55 46 67 59 49 70 89 33 60 63 45 63 56 54
V: 59 55 62 46 60 54 52 55 65 63 56 48 53 54 51 50 54 69 59 51 48 56 46 57100 54
W: 34 58 75 62 50 36 43 55 51104 69 49 65 36 57 40 63 62 52 29 65 52 48 41 71 39
X: 66 46 64 46 58 61 56 49 68 42 63 59 43 59 57 72 49 68 47111 65 49 47 62 44 64
Y: 59 61 61 82 65 62 63 43 49 44 43 50 68 50 60105 53 53 57 61 40 53 58 56 45 75
Z: 59 91 41 47 51 46 57 55 52 74 61 70 77 54 48 67 44 51 48 51 52 59 54 50 51 51

We obtain the following pairs (each couple of letters being separated by 4 letters):
AS, BZ, CE, DR, EF, FA, JW.

We can now reconstruct the wiring:

      Z...Q...X...S
      Z...Q..AX...S........B....
      Z.F.Q.VAX..DS..L.....B....
      Z.F.Q.VAX..DSN.L.U...B....
      Z.F.Q.VAX..DSN.L.UC..B.E..
      ZYF.Q.VAX..DSNHL.UCO.BPE..
      ZYFTQ.VAX..DSNHLRUCOKBPE.G
Finally, we obtain the complete wiring of the rotor:
       
      ZYFTQJVAXMWDSNHLRUCQKBPEIG