Put messages in-depth


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

Introduction

Most cryptanalysis methods require specific methods. There is a universal method that can be applied to any cryptographic technique includes the most modern: this is the method of Kerckoff superposition.

Two problems:

  • 1) Detect if messages are in-depth. The simple fact that they use the same indicator can be enough.
  • 2) Deduce the alphabets of each column. This problem is more or less complex depending on the system used and the possible use of Cribs. Unfortunately, in the case of rotor use, it is necessary to have at least 50 in-depth messages to hope to find the plain text of the messages.

Note: this method was described in the context of a substitution. He is possible to use it for a transposition.

Putting messages "in-depth" can also be used to merge several small cryptograms to make just one big cryptogram.

Criteria

The simplest method to detect if two messages are "in-depth", is to count the number of identical characters at the same positions. We thus counts the “coincidences”.

Example:

Cryptogram 1: YYSIV LAFDV SNWLZ CZMWX NJUMV HJIZP QTEJA YXYMU ZYPYE KKFJN 
Cryptogram 2: YMCWJ YGORM BNTSJ PWVKF UJLTP LLXHP FQWIM GBXTD XPQUN KZATG
Coincidences: *                        *        *                   *   

Another method, invented by Alan Turing, is Bamburismus. The interest of this method compared to simple counting of coincidences is to include in the calculation the length of the area compared in the two texts.

The presence of bigram coincidences corresponds to added value.

  BF = ((P ** M) * ((1-P)**(N-M))) / (((1./26)**M)*((25./26)**(N-M)))
  BFdB = int(  20 * log (BF ))
With
    - M is the number of coincidences
    - N is the length of superpimposition
    - P = 0.0667 = value of IC for English
    (English,0.0667, French,0.0778. German,0.0762, Spanish,0.0770).

Example

Creation of the test game

C:\H1_TOOLS> python hebern1_tui.py -R p17 -E Z < MSGS\p25.pln > MSGS\p25.cry
C:\H1_TOOLS> python hebern1_tui.py -R p17 -E G < MSGS\p19.pln > MSGS\p19.cry

Finding the Overlay Position

C:\H1_TOOLS>  python superimpose.py
Syntaxe: superp.py crypto1 crypto2 [IC_threhold [length superp]]
         by default, the IC_threhold is 0.055
         by default, the length of superpimposition is 50 letters

C:\H1_TOOLS> python superimpose.py MSGS\p25.cry MSGS\p19.cry 0.1
lenght:  100 321  smallest:  100
Coincidences   IC   length_msg offset-1 offset-2  Bambu big length_superp
   9           0.1111      100       19        0    56.0 3    81
  12           0.1200      100        0        7    79.0 1   100
  11           0.1100      100        0      111    68.0 0   100
  12           0.1200      100        0      189    79.0 3   100

The results are consistent with a key offset of 7 positions (H-A = 7). Offsets 111 and 189 correspond respectively to 26x4+7 and 26x7+7. Because the key has a maximum value of 25, all the 26 characters, we return to the initial key.