[JoGu]

Cyptology

Isomorphs: Example

a7Hzq .#5r<
kÜ\as TâÆK$
ûj(Ö2 ñw%h:
Úk{4R f~`z8
¤˜Æ+Ô „&¢Dø

The Ciphertext

Using a two rotor machine with odometer logic and the rotor wirings

   PABCVDZEYFNOUXTSGWRHQIJKLM (Rotor A)
   KGLMBNFCEOPJQDARSHTIUVWXYZ (Rotor B)
and the corresponding primary alphabets
   BCDFHJQTVWXYZKLAUSPOMERNIG (Rotor A)
   OEHNIGBRTLACDFJKMPQSUVWXYZYZ (Rotor B)
that are assumed known to the attacker, we encrypt a plaintext with a certain rotor order and initial position, getting the ciphertext (of length 99):
   NHAHR EDBVY TUFKR VWMCO YKFEL QFCYN RSOIX VEVCX UCGZC YXVGY
   HFWPI QVWKM HIGQP GPAOK TBOAE BEXFU SAAJA LOCWN JVFVV VVWG

Note that this is an extremely weak cipher if we assume the rotor wirings known to the enemy. An exhaustion attack only costs 2 × 262 = 1352 trial decryptions in the worst case, see »Attack 0« below. Nevertheless we use it as a prototype for demonstrating other attack methods.


The Alphabet Tables

For convenience here are the complete alphabet tables of the two rotors and of the inverse transformations.

Rotor A:

     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
Pos  ---------------------------------------------------
 0   B C D F H J Q T V W X Y Z K L A U S P O M E R N I G
 1   H C D E G I K R U W X Y Z A L M B V T Q P N F S O J
 2   K I D E F H J L S V X Y Z A B M N C W U R Q O G T P
 3   Q L J E F G I K M T W Y Z A B C N O D X V S R P H U
 4   V R M K F G H J L N U X Z A B C D O P E Y W T S Q I
 5   J W S N L G H I K M O V Y A B C D E P Q F Z X U T R
 6   S K X T O M H I J L N P W Z B C D E F Q R G A Y V U
 7   V T L Y U P N I J K M O Q X A C D E F G R S H B Z W
 8   X W U M Z V Q O J K L N P R Y B D E F G H S T I C A
 9   B Y X V N A W R P K L M O Q S Z C E F G H I T U J D
10   E C Z Y W O B X S Q L M N P R T A D F G H I J U V K
11   L F D A Z X P C Y T R M N O Q S U B E G H I J K V W
12   X M G E B A Y Q D Z U S N O P R T V C F H I J K L W
13   X Y N H F C B Z R E A V T O P Q S U W D G I J K L M
14   N Y Z O I G D C A S F B W U P Q R T V X E H J K L M
15   N O Z A P J H E D B T G C X V Q R S U W Y F I K L M
16   N O P A B Q K I F E C U H D Y W R S T V X Z G J L M
17   N O P Q B C R L J G F D V I E Z X S T U W Y A H K M
18   N O P Q R C D S M K H G E W J F A Y T U V X Z B I L
19   M O P Q R S D E T N L I H F X K G B Z U V W Y A C J
20   K N P Q R S T E F U O M J I G Y L H C A V W X Z B D
21   E L O Q R S T U F G V P N K J H Z M I D B W X Y A C
22   D F M P R S T U V G H W Q O L K I A N J E C X Y Z B
23   C E G N Q S T U V W H I X R P M L J B O K F D Y Z A
24   B D F H O R T U V W X I J Y S Q N M K C P L G E Z A
25   B C E G I P S U V W X Y J K Z T R O N L D Q M H F A

Rotor A inverse:

     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
Pos  ---------------------------------------------------
 0   P A B C V D Z E Y F N O U X T S G W R H Q I J K L M
 1   N Q B C D W E A F Z G O P V Y U T H X S I R J K L M
 2   N O R C D E X F B G A H P Q W Z V U I Y T J S K L M
 3   N O P S D E F Y G C H B I Q R X A W V J Z U K T L M
 4   N O P Q T E F G Z H D I C J R S Y B X W K A V L U M
 5   N O P Q R U F G H A I E J D K S T Z C Y X L B W M V
 6   W O P Q R S V G H I B J F K E L T U A D Z Y M C X N
 7   O X P Q R S T W H I J C K G L F M U V B E A Z N D Y
 8   Z P Y Q R S T U X I J K D L H M G N V W C F B A O E
 9   F A Q Z R S T U V Y J K L E M I N H O W X D G C B P
10   Q G B R A S T U V W Z K L M F N J O I P X Y E H D C
11   D R H C S B T U V W X A L M N G O K P J Q Y Z F I E
12   F E S I D T C U V W X Y B M N O H P L Q K R Z A G J
13   K G F T J E U D V W X Y Z C N O P I Q M R L S A B H
14   I L H G U K F V E W X Y Z A D O P Q J R N S M T B C
15   D J M I H V L G W F X Y Z A B E P Q R K S O T N U C
16   D E K N J I W M H X G Y Z A B C F Q R S L T P U O V
17   W E F L O K J X N I Y H Z A B C D G R S T M U Q V P
18   Q X F G M P L K Y O J Z I A B C D E H S T U N V R W
19   X R Y G H N Q M L Z P K A J B C D E F I T U V O W S
20   T Y S Z H I O R N M A Q L B K C D E F G J U V W P X
21   Y U Z T A I J P S O N B R M C L D E F G H K V W X Q
22   R Z V A U B J K Q T P O C S N D M E F G H I L W X Y
23   Z S A W B V C K L R U Q P D T O E N F G H I J M X Y
24   Z A T B X C W D L M S V R Q E U P F O G H I J K N Y
25   Z A B U C Y D X E M N T W S R F V Q G P H I J K L O

Rotor B:

     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
Pos  ---------------------------------------------------
 0   O E H N I G B R T L A C D F J K M P Q S U V W X Y Z
 1   A P F I O J H C S U M B D E G K L N Q R T V W X Y Z
 2   A B Q G J P K I D T V N C E F H L M O R S U W X Y Z
 3   A B C R H K Q L J E U W O D F G I M N P S T V X Y Z
 4   A B C D S I L R M K F V X P E G H J N O Q T U W Y Z
 5   A B C D E T J M S N L G W Y Q F H I K O P R U V X Z
 6   A B C D E F U K N T O M H X Z R G I J L P Q S V W Y
 7   Z B C D E F G V L O U P N I Y A S H J K M Q R T W X
 8   Y A C D E F G H W M P V Q O J Z B T I K L N R S U X
 9   Y Z B D E F G H I X N Q W R P K A C U J L M O S T V
10   W Z A C E F G H I J Y O R X S Q L B D V K M N P T U
11   V X A B D F G H I J K Z P S Y T R M C E W L N O Q U
12   V W Y B C E G H I J K L A Q T Z U S N D F X M O P R
13   S W X Z C D F H I J K L M B R U A V T O E G Y N P Q
14   R T X Y A D E G I J K L M N C S V B W U P F H Z O Q
15   R S U Y Z B E F H J K L M N O D T W C X V Q G I A P
16   Q S T V Z A C F G I K L M N O P E U X D Y W R H J B
17   C R T U W A B D G H J L M N O P Q F V Y E Z X S I K
18   L D S U V X B C E H I K M N O P Q R G W Z F A Y T J
19   K M E T V W Y C D F I J L N O P Q R S H X A G B Z U
20   V L N F U W X Z D E G J K M O P Q R S T I Y B H C A
21   B W M O G V X Y A E F H K L N P Q R S T U J Z C I D
22   E C X N P H W Y Z B F G I L M O Q R S T U V K A D J
23   K F D Y O Q I X Z A C G H J M N P R S T U V W L B E
24   F L G E Z P R J Y A B D H I K N O Q S T U V W X M C
25   D G M H F A Q S K Z B C E I J L O P R T U V W X Y N

Rotor B inverse:

     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
Pos  ---------------------------------------------------
 0   K G L M B N F C E O P J Q D A R S H T I U V W X Y Z
 1   A L H M N C O G D F P Q K R E B S T I U J V W X Y Z
 2   A B M I N O D P H E G Q R L S F C T U J V K W X Y Z
 3   A B C N J O P E Q I F H R S M T G D U V K W L X Y Z
 4   A B C D O K P Q F R J G I S T N U H E V W L X M Y Z
 5   A B C D E P L Q R G S K H J T U O V I F W X M Y N Z
 6   A B C D E F Q M R S H T L I K U V P W J G X Y N Z O
 7   P B C D E F G R N S T I U M J L V W Q X K H Y Z O A
 8   B Q C D E F G H S O T U J V N K M W X R Y L I Z A P
 9   Q C R D E F G H I T P U V K W O L N X Y S Z M J A B
10   C R D S E F G H I J U Q V W L X P M O Y Z T A N K B
11   C D S E T F G H I J K V R W X M Y Q N P Z A U B O L
12   M D E T F U G H I J K L W S X Y N Z R O Q A B V C P
13   Q N E F U G V H I J K L M X T Y Z O A S P R B C W D
14   E R O F G V H W I J K L M N Y U Z A P B T Q S C D X
15   Y F S P G H W I X J K L M N O Z V A B Q C U R T D E
16   F Z G T Q H I X J Y K L M N O P A W B C R D V S U E
17   F G A H U R I J Y K Z L M N O P Q B X C D S E W T V
18   W G H B I V S J K Z L A M N O P Q R C Y D E T F X U
19   V X H I C J W T K L A M B N O P Q R S D Z E F U G Y
20   Z W Y I J D K X U L M B N C O P Q R S T E A F G V H
21   I A X Z J K E L Y V M N C O D P Q R S T U F B G H W
22   X J B Y A K L F M Z W N O D P E Q R S T U V G C H I
23   J Y K C Z B L M G N A X O P E Q F R S T U V W H D I
24   J K Z L D A C M N H O B Y P Q F R G S T U V W X I E
25   F K L A M E B D N O I P C Z Q R G S H T U V W X Y J

Attack 0, Exhaustion

We have two possible rotor arrangements, and for each of them 26×26 = 676 different initial states. We go through all of these 1352 settings and perform a trial decryption for each of them. In each case we record the coincidence index of the result. Let's take notice of it, if > 0.45.

The rotor positions are noted as the pair »pos1|pos2« or as the integer »pos1x26+pos2«.

For the first rotor arrangement we get the trial decryptions:

Rotor initial position: 32 = 01|06 -- Coincidence Index: 0.0460
   PATATWWHIIBCZPHRJLONLXWWAJERNSVUYBYCTDFXTOHDHLTHXLAELHGXNOHIGCGAXHXTDRJFTNHOTJEULPPHYIRFTJINDAAAABK
Rotor initial position: 35 = 01|09 -- Coincidence Index: 0.0640 <===
   JAPANESEDESIGNERSAPPLIEDTHEIRKNOWLEDGEOFTHEMILITARYENIGMAWHICHHADBEENSHOWNTOTHEMBYTHEIRGERMANALLIES
Rotor initial position: 36 = 01|10 -- Coincidence Index: 0.0458
   JATJNTAEDRSIQYXJSURYQFEDTZEDSQNOWATNGJAKTBRMPLLTFNYEZLGMZUMIJZDAAPWDTFAOWNTYTJEYNTUUENRUOQJATLLIBWE
Rotor initial position: 53 = 02|01 -- Coincidence Index: 0.0458
   HDNVZDCRYWWZJASIYOLCFNNPCVRPLCXAQGQNEWRJWNVLLYPUPLPPVWERLUWAGZFMKVSERNWNSHQDOWKIRNNCOXECOWAXGCRRNOE
Rotor initial position: 139 = 05|09 -- Coincidence Index: 0.0462
   BGJGNFYFRFYXINFLMBFFXASRZJSAPCWOEXSRISOGZJSYKDKNMLWSOKHYMUJKIJJMRCSSZMIPWZRPRISENGRISKHUSHEFZFDDJKI
Rotor initial position: 165 = 06|09 -- Coincidence Index: 0.0462
   MGFGWVDVRVDZBWVYZJKKDVSRECSVPNOXLDSRISXWECSEDODAGHUSZDXEGNJDIJJGRKSSFIYAWFRARYSPHNRYSKMUSMPDFDYYZKN
Rotor initial position: 207 = 07|25 -- Coincidence Index: 0.0466
   QTZRURQPKZOECJZCFDUHFDJEPTEUBOUVJEPPRFRQWOVDUTTSKZLREGUTKLUXUVTDDYXDFCDHFVQDRHMWQDDTDVMKDZWKYQCPSBX
Rotor initial position: 493 = 18|25 -- Coincidence Index: 0.0489
   GQXHMHGRKXWSTPXTUAMBUAPSRQBRPFRNABXXHTHSGFNUROOIQZLHVUPJBRPHPSJXXKHXCQXWCSYXTWSTHRRJRQSERLTEIHAFUBP
Rotor initial position: 503 = 19|09 -- Coincidence Index: 0.0493
   VMAMXQIQHQITPXQUVALLPFIHJQIFSWTYKPIHMIYRJQIQRXRWDCPIYRSQDENRONNDABIIRDTZGRUZUTBYEMUTBONKBNYIRIIIUQO
Rotor initial position: 573 = 22|01 -- Coincidence Index: 0.0456
   OURMDUAVGNNDIPLFGZXAKRRCRFTAXROEDLDZVNTGNZFXXKAIAXTTJGCEKNGIDLWYHJUCEZGZUMBSAKRNCZZGAHTGAKMHXGCCZAT
Rotor initial position: 633 = 24|09 -- Coincidence Index: 0.0464
   JDRDZWGWXWGHSZWIJNWWLGYCHTYGBKZARLYCMYAXHTDMULUKGTEDPUYMGWNUFNNGVODDNUZQSNDQDZWMHTDZWOYAWYMRNRJJAHZ
Rotor initial position: 671 = 25|21 -- Coincidence Index: 0.0454
   UWMUEXYAOXFNDSUPAUTTQMIBAGNNYMAFXTPKDABZMXECYCXXXEKGETVEJSXUVUVJAXKRKAOEWEBKGXATIEHENYJPLIRMENNWAWG

The reverse rotor arrangement likewise yields:

Rotor initial position: 02 = 00|02 -- Coincidence Index: 0.0501
   SFDFUHZFYFQDVFFUVJZDXTYVEVNBKPJVKVCTFIKJUCSXZXKDMQANGUPJABEQVKVFNWMCBADZJZMANFJFCLMQOFSUUAOVFKKKFHC
Rotor initial position: 28 = 01|02 -- Coincidence Index: 0.0472
   SOROJTZOYOKRVOOJVQZRXIYKSKNFRGVKRKOTEURVJOCXZXRHIHAJFUEVABIHKWKTJLCGBAPZVZCADJOJCXTFKJSEEAKVJWWWJGC
Rotor initial position: 77 = 02|25 -- Coincidence Index: 0.0464
   XASYBDGXOBTGVXGMTZOBTSBBWWDBGUBCOQADAYEASIXNKXXJRMDYGWBAABBSWXFTTWTDBNIVSNWIYSDRRIIAYCMVELYTHKJLGXK
Rotor initial position: 97 = 03|19 -- Coincidence Index: 0.0470
   BTDFOCCURGXMERSDOGESBMFTZDFZMDKPFPSWFKUJCOFEIBFTMXSJXKOERGIUFQFJTJLFFNVQDDSELKRMFOOLLJYLHDNPQDOOWQF
Rotor initial position: 103 = 03|25 -- Coincidence Index: 0.0458
   MASYBHUMKBNUVMUTNZKBNSBBLLDBKOBCEQADANIAJHMUPMMSGYDNSGBAABBHGXJKKGKDBZWPHZGWNHDNNMMPYCRVEUYITJXUKHJ
Rotor initial position: 112 = 04|08 -- Coincidence Index: 0.0486
   OWDWFWFOIHFRFNSFRWBMKDWVCLIBRHRGBQOWQWZMQFDLBTJAFNYWQIXMTLNONZVDTSKOPMQJWMWJWPQZLFTYDOBFHBJNHNNSWXF
Rotor initial position: 113 = 04|09 -- Coincidence Index: 0.0456
   IWKDUQSOWXPQBWKFGUVVWRIVSJIQLCOVBJXWQSXHQBOLPTTTXDGWEQXUWJQOHTKDDCGOXGOJWMWZWCQVITNFDRBOHUXNCNSWOTF
Rotor initial position: 244 = 09|10 -- Coincidence Index: 0.0458
   VSPZLTUJSOGHZXLIJXXMVROMUJRORCPMRKLZCICUHDTRMZUOPXZNLXAMXMOIRWJRXUFYCMJXKBZYZHDKNITVBPDRARZICIOJPRG
Rotor initial position: 335 = 12|23 -- Coincidence Index: 0.0468
   NVYQPFZTWFBCACYLMDKNOYIQTUENLQTQAWOEAFRVKVVOKQQTYCKQJVDQJKPJWIQNNQOKPTBGFTICCMSIWNNGNQQPZQVUCLBOCRL
Rotor initial position: 361 = 13|23 -- Coincidence Index: 0.0464
   ZCUETFZYDFSCPCULMXKRAUIEYGORLUCUAISYAPFHKHHSKUUCOTKUJHUCYKTYIXCNNCOKTSBQZSXRRMGXBNNANUUPGUETCLXOCDL
Rotor initial position: 363 = 13|25 -- Coincidence Index: 0.0451
   CENDRAZCVRUZBCZYUXVRUNRRQQPFLVFSGIYPYDBYNMRZHRRKJTPDYRZFFZZKRDCOOROTZUBWKURBSKHYYNNFEAJQUMELZOCMDSO
Rotor initial position: 444 = 17|02 -- Coincidence Index: 0.0489
   QINIDBVITIMNSIIDSLVNWXTEOEIPMLDEMEVRZCMDYVQFUFMKBMVCASTDVXLMZEZPCFHQXVWYDYHZIMJMYFOUDMCSSZDTMEEEMBY
Rotor initial position: 476 = 18|08 -- Coincidence Index: 0.0466
   IDBDKDKIMRKZKPNKZZXFMIZRHWSXKBKLXTQZTZYFTDINWBTZDGFSKCAXBNGHGVQIBLOHROSDRORDRISGPKMBZHAKFADYFYYMRSK
Rotor initial position: 496 = 19|02 -- Coincidence Index: 0.0499
   QWNWZRYWGWBNEWWZEMYNUSGAOAJPNMEANADRLSNETDQGHGNUINIJMSLTIAVNUFUPJBXQAIEWTWXXYWAWBGPMKWDSSXKTWUUUWNB
Rotor initial position: 600 = 23|02 -- Coincidence Index: 0.0474
   FLPLURILDLOPVLLUVXIPHSDVQVDFYOUVYVAGHSYUTARXEXYNLPFMIHDTFKOPUVURMWLGKFBJTJLKMPBPLWAENPDTTKNIPUUUPJL
Rotor initial position: 623 = 23|25 -- Coincidence Index: 0.0464
   XJPIKGRXAKFRTXRQFEAKFPKKVVAKPGKLMDFAFYHFZCWREWWIOXAYOUGKKGGPUVIAAUAMGYTHPYUTXPMDDRRAWHGSNKWQPEUKJVE
Rotor initial position: 626 = 24|02 -- Coincidence Index: 0.0489
   RCPCUGECICYPVCCUVBEPXSIVQVMRCIUVCVESOHCUTEGXJXCNAJKBPTCIKGOJUVURBWLSGKFZIZLAMPNPHWEDCPRIIACUPJJJPQH
Rotor initial position: 652 = 25|02 -- Coincidence Index: 0.0466
   GBZBUSJBYBCZVBBUVPJZXHYVAVBRQPUVQVNHOTQUINSXZXQEMQANPIGUALFQJVJBNWHSLAOZUZHAIGNGMWSHOGLUUAOJGVVVGQM

By far the highest value of the coincidence index occurs for the first rotor setting with initial position 01|09, and it yields the correct plaintext.

The costs for this attack were 1352 encryptions and coincidence calculations for an unsupervised execution of the algorithm. If we look at the intermediate results, then of course we can stop the execution after rotor position 35.

Exercise. Apply the MFL-test or the BLW-test instead of calculating coincidence indices.


Attack 1, Known Plaintext/ Isomorphs

Assume the plaintext begins with the probable word »Japanese«. We want to find the order of the rotors and the initial position, that is the key.

We have (or assume) known plaintext of length 8 and the situation:

a1 = Jb1 = ?c1 = N
a2 = Ab2 = ?c2 = H
a3 = Pb3 = ?c3 = A
a4 = Ab4 = ?c4 = H
a5 = Nb5 = ?c5 = R
a6 = Eb6 = ?c6 = E
a7 = Sb7 = ?c7 = D
a8 = Eb8 = ?c8 = B

The numerical pattern of the plaintext a is 12324565.

We try each rotor in each position, apply its inverse permutation to the ciphertext c = NHAHREDB until we find a result with the numerical pattern 12324565.

For Rotor A we get 26 possible results:

   Rotor position 00 -- intermediate text: VFNGZRQP 12345678
   Rotor position 01 -- intermediate text: QYNGURQA 12345617
   Rotor position 02 -- intermediate text: QGNGURZG 12324562
   Rotor position 03 -- intermediate text: JGWWNRRR 12334555
   Rotor position 04 -- intermediate text: DGOUHACE 12345678
   Rotor position 05 -- intermediate text: KWZUOSIG 12345678
   Rotor position 06 -- intermediate text: GUFUKDTL 12324567
   Rotor position 07 -- intermediate text: LUQUPJGJ 12324565 <=== !
   Rotor position 08 -- intermediate text: EUDUIUIE 12324241
   Rotor position 09 -- intermediate text: MUFDQHNE 12345678
   Rotor position 10 -- intermediate text: MUKVQJLX 12345678
   Rotor position 11 -- intermediate text: MDIGQOGR 12345647
   Rotor position 12 -- intermediate text: CVDMGMGY 12345456
   Rotor position 13 -- intermediate text: AGDXEHZU 12345678
   Rotor position 14 -- intermediate text: AMWKEHTZ 12345678
   Rotor position 15 -- intermediate text: AXQMEAAS 12345116
   Rotor position 16 -- intermediate text: AKXREUWA 12345671
   Rotor position 17 -- intermediate text: AMTPEBBA 12345661
   Rotor position 18 -- intermediate text: JRYKNXUA 12345678
   Rotor position 19 -- intermediate text: BPRKFCCQ 12345667
   Rotor position 20 -- intermediate text: MKZDQVCO 12345678
   Rotor position 21 -- intermediate text: SKZXWDCO 12345678
   Rotor position 22 -- intermediate text: DDZEHDSO 11234156
   Rotor position 23 -- intermediate text: QXPAUDQO 12345617
   Rotor position 24 -- intermediate text: SENFWTQO 12345678
   Rotor position 25 -- intermediate text: XANYBRQX 12345671

For Rotor B we get 26 possible results:

   Rotor position 00 -- intermediate text: RPAQVEDQ 12345674
   Rotor position 01 -- intermediate text: LEAQPEDC 12345267
   Rotor position 02 -- intermediate text: SQAMWEDR 12345678
   Rotor position 03 -- intermediate text: SQARWESD 12345617
   Rotor position 04 -- intermediate text: JMPHNEED 12345667
   Rotor position 05 -- intermediate text: IRBHMTTN 12345667
   Rotor position 06 -- intermediate text: MHQHQFFR 12323445
   Rotor position 07 -- intermediate text: VHCHZUFF 12324566
   Rotor position 08 -- intermediate text: KHCHOGPZ 12324567
   Rotor position 09 -- intermediate text: WHMHAGTG 12324565 <=== !
   Rotor position 10 -- intermediate text: WHQWAQHG 12314325
   Rotor position 11 -- intermediate text: SHEIWUBX 12345678
   Rotor position 12 -- intermediate text: XWYXBIIW 12314552
   Rotor position 13 -- intermediate text: NIFJRCIA 12345627
   Rotor position 14 -- intermediate text: NXFJRJZJ 12345464
   Rotor position 15 -- intermediate text: NJWTRJYY 12345266
   Rotor position 16 -- intermediate text: NJVXRACK 12345678
   Rotor position 17 -- intermediate text: NTZLRZLK 12345346
   Rotor position 18 -- intermediate text: NXIFRDAG 12345678
   Rotor position 19 -- intermediate text: CLXMGMML 12345442
   Rotor position 20 -- intermediate text: OFJMSBMB 12345646
   Rotor position 21 -- intermediate text: DMJDHNIB 12314567
   Rotor position 22 -- intermediate text: PMFCTNNB 12345667
   Rotor position 23 -- intermediate text: PDKGTJDB 12345627
   Rotor position 24 -- intermediate text: ZCAPDODB 12345657
   Rotor position 25 -- intermediate text: DGAEHEDB 12345416

This yields two possible arrangements for the fast rotor: Rotor A in position 7, or rotor B in position 9.

If the machine had more than two rotors, we would next strip off the effect of the fast rotor, that is »decrypt« the complete ciphertext with the last rotor A in initial position 7 or B in initial position 9.

Since the machine has only two rotors, we simply decrypt the intermediate text with all 26 positions of the first rotor (in fixed position, no stepping).

Case A:

   Rotor position 00 -- supposed plaintext: JUSUROFO
   Rotor position 01 -- supposed plaintext: QJSJBFOF
   Rotor position 02 -- supposed plaintext: QVCVFEDE
   Rotor position 03 -- supposed plaintext: HKGKTIPI
   Rotor position 04 -- supposed plaintext: GWUWNRPR
   Rotor position 05 -- supposed plaintext: KWOWUGLG
   Rotor position 06 -- supposed plaintext: TGVGUSQS
   Rotor position 07 -- supposed plaintext: IKVKLSGS
   Rotor position 08 -- supposed plaintext: UYMYKOGO
   Rotor position 09 -- supposed plaintext: USLSOTGT
   Rotor position 10 -- supposed plaintext: QZPZXJGJ
   Rotor position 11 -- supposed plaintext: VZYZMJGJ
   Rotor position 12 -- supposed plaintext: LQNQYJGJ
   Rotor position 13 -- supposed plaintext: LPZPYJVJ
   Rotor position 14 -- supposed plaintext: LTZTUJHJ
   Rotor position 15 -- supposed plaintext: LCVCZJWJ
   Rotor position 16 -- supposed plaintext: LRARPYIY
   Rotor position 17 -- supposed plaintext: LDQDPKIK
   Rotor position 18 -- supposed plaintext: ADQDPZSZ
   Rotor position 19 -- supposed plaintext: MZQZPLWL
   Rotor position 20 -- supposed plaintext: BEQEPLKL
   Rotor position 21 -- supposed plaintext: NUQUPVEV
   Rotor position 22 -- supposed plaintext: NUQUEZLZ
   Rotor position 23 -- supposed plaintext: XUFUQNLN
   Rotor position 24 -- supposed plaintext: BURUFHCH
   Rotor position 25 -- supposed plaintext: PUGUROBO

Case B:

   Rotor position 00 -- supposed plaintext: JEUEPZHZ
   Rotor position 01 -- supposed plaintext: JAPANESE <===
   Rotor position 02 -- supposed plaintext: SFPFNXYX
   Rotor position 03 -- supposed plaintext: KYIYNFJF
   Rotor position 04 -- supposed plaintext: VGCGNFWF
   Rotor position 05 -- supposed plaintext: BGJGNFYF
   Rotor position 06 -- supposed plaintext: MGFGWVDV
   Rotor position 07 -- supposed plaintext: ZWKWOTBT
   Rotor position 08 -- supposed plaintext: BUDUZTWT
   Rotor position 09 -- supposed plaintext: GULUFTWT
   Rotor position 10 -- supposed plaintext: EULUQTPT
   Rotor position 11 -- supposed plaintext: ZULUDTJT
   Rotor position 12 -- supposed plaintext: ZUBUFCQC
   Rotor position 13 -- supposed plaintext: SDZDKUMU
   Rotor position 14 -- supposed plaintext: MVZVIFRF
   Rotor position 15 -- supposed plaintext: TGZGDLKL
   Rotor position 16 -- supposed plaintext: PMZMDWSW
   Rotor position 17 -- supposed plaintext: UXZXWJSJ
   Rotor position 18 -- supposed plaintext: NKIKQLSL
   Rotor position 19 -- supposed plaintext: VMAMXQIQ
   Rotor position 20 -- supposed plaintext: VRLRTOGO
   Rotor position 21 -- supposed plaintext: VPRPYJGJ
   Rotor position 22 -- supposed plaintext: LKCKRJGJ
   Rotor position 23 -- supposed plaintext: JKPKZCGC
   Rotor position 24 -- supposed plaintext: JDRDZWGW
   Rotor position 25 -- supposed plaintext: JXWXZDPD

We found a unique solution in case B: Rotor A at the left as slow rotor with initial position 1, rotor B at the right as fast rotor with initial position 9. With these settings we decrypt the complete ciphertext.

Although (in this case) the brute force exhaustion was feasible, the known plaintext attack was significantly cheaper: we needed only 4×26 = 104 decryptions of a 8-letter string with one rotor, plus 2×26 = 52 numerical pattern determinations, plus a final single decryption of the full ciphertext with the complete 2-rotor machine.


Author: Klaus Pommerening, 2000-Feb-16; last change: 2014-Jun-11.