Post by Arnaud on Jan 19, 2018 16:56:45 GMT
Hi guys,
I am usualy not such a cryptanalysis fan, mainly because I don't understand it. But i recently took a shot at the Enigma challenge on Dirk's site.
As I was trying to understand how things work, something struck my mind.
I am pretty sure (some) people know about this, but I did not. Maybe you "statistics knowing people" can make numbers out of this but not me, this is pure gut feelings
Let's use M3 enigma so to have less rotors to think about. and no steckerboard to simplifya bit a lot.
Let's use this key
UKW: B
Walzen: I II III
Ringstellung: B-02 C-03 D-04
Stecker: None
Start position AAA
and type some text.
I chose this one
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
and got
RCGRC YJFHV MVGJW ZHZDM RDDGY SYDGW FFTEM JEMIH RPUBT WQOHF NPNOF CESMM XZAFN JJEUM HMJCW RTDKA ZQTRO RKHHM XYPLI WBGCY RXLDW AXMET VQDNC UXOSH KHJVB UTYQB UXTTN CQNPF IHBAU QPXDG HKJUT KWMIR FUKGD SMLYP IRCFG MWVLW WZNXZ RFFNJ TXHNR HWCDG OJLPV GKLJM KVZBN XOAUV JIEXC RUKFG CESSI QUEVF TRBHL ORAZF SDMGZ UCQRH AR
now, let's reset the rings and think about what happens to the electric cables inside the wheels. Whenever you change the ring settings, the output of the connection changes but the relative order stays the same (if 1 is linked to 5 and 2 to 6, when I change the settings for 1 to be linked as 7 then 2 will be linked with 9).
Because of this, when I reset the rings I slide the connections backwards (in this case, once for wheel I, twice for wheel II and three times for wheel III). I can then push the connections frontwards by just rotating the wheels (changing the start position) the opposite directions by the same amount of cliks.
This gives me the following key
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 A-01
Stecker: None
Start position ZYX
Here is what I get
THISMESSAGECONTAINSCOIZDDENTIALINFORMATIONANDISFRLENDEDONLYFORTHEINDIVIDULMWAMEDIFYOUARENOTTHENAMEDNNQYAGSGURSXLNSUVNMOTEVIASZWGJFKBCFIOPUASFBFDMBDRLCWEVWJLPLEASENOTIFYTHESENDERSHFEDIATELYBYEMAILIFYOUHAVESACEIVEDTHISEMAILBYMISTAKMJGDDELETETHISEMAILFROMYOUDAKSTEM
looking good but not quite...the message starts all right but goes wierd after 20 some letter...I guess that is when the second wheel turned. Wrong timing due to wrong start position.
This means that to get the message right (at least untill the third wheel moves) I only need to find the right ring setting for the fast wheel and then the right start position (given that I have the right wheels in the right order). I will know I found it because it will give me the most caracters right in the text
This also means that for the beginning of the message (untill second wheel moves), the settings of the rightmost wheel - "Start A Ring D" or "Start B Ring E" or "Start C Ring F"......and so on will all have the same outcome.
This means that if the beginning of the message is no good with one of those, there is no use in testing the others....therfore eliminating a lot of possibilities (around 26 per wheel I suppose) and saving a lot of time.
With
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 E-05
Stecker: None
Start position ZYB
i get the 20 first caracters of the clear message right....and after a short gibberish output, it then becomes readable again......not so bad for something pretty far from the original settings.
With
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 Y-25
Stecker: None
Start position ZXV
Gives me 21 first caracters
With
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 D-04 (correct ring setting)
Stecker: None
Start position ZYA (correct start position)
I get, in this case, 99 first caracters correct.
I am pretty sure that once you have done it for the first wheel, you can attack the next in about the same way.
I cannot translate this in numbers and statistics, but I am sure this eliminates lots of possibilities (possibly more than the fact that a letter cannot encrypt to itself in my (humble) opinion) and gives a nice method to help search for the right key.
I am pretty sure that someone has thought of that before me and I probably reinvented the wheel here. (does this technique exist and have a name by any chance).
But I thought I'd share it anyway.
I am usualy not such a cryptanalysis fan, mainly because I don't understand it. But i recently took a shot at the Enigma challenge on Dirk's site.
As I was trying to understand how things work, something struck my mind.
I am pretty sure (some) people know about this, but I did not. Maybe you "statistics knowing people" can make numbers out of this but not me, this is pure gut feelings
Let's use M3 enigma so to have less rotors to think about. and no steckerboard to simplify
Let's use this key
UKW: B
Walzen: I II III
Ringstellung: B-02 C-03 D-04
Stecker: None
Start position AAA
and type some text.
I chose this one
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
and got
RCGRC YJFHV MVGJW ZHZDM RDDGY SYDGW FFTEM JEMIH RPUBT WQOHF NPNOF CESMM XZAFN JJEUM HMJCW RTDKA ZQTRO RKHHM XYPLI WBGCY RXLDW AXMET VQDNC UXOSH KHJVB UTYQB UXTTN CQNPF IHBAU QPXDG HKJUT KWMIR FUKGD SMLYP IRCFG MWVLW WZNXZ RFFNJ TXHNR HWCDG OJLPV GKLJM KVZBN XOAUV JIEXC RUKFG CESSI QUEVF TRBHL ORAZF SDMGZ UCQRH AR
now, let's reset the rings and think about what happens to the electric cables inside the wheels. Whenever you change the ring settings, the output of the connection changes but the relative order stays the same (if 1 is linked to 5 and 2 to 6, when I change the settings for 1 to be linked as 7 then 2 will be linked with 9).
Because of this, when I reset the rings I slide the connections backwards (in this case, once for wheel I, twice for wheel II and three times for wheel III). I can then push the connections frontwards by just rotating the wheels (changing the start position) the opposite directions by the same amount of cliks.
This gives me the following key
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 A-01
Stecker: None
Start position ZYX
Here is what I get
THISMESSAGECONTAINSCOIZDDENTIALINFORMATIONANDISFRLENDEDONLYFORTHEINDIVIDULMWAMEDIFYOUARENOTTHENAMEDNNQYAGSGURSXLNSUVNMOTEVIASZWGJFKBCFIOPUASFBFDMBDRLCWEVWJLPLEASENOTIFYTHESENDERSHFEDIATELYBYEMAILIFYOUHAVESACEIVEDTHISEMAILBYMISTAKMJGDDELETETHISEMAILFROMYOUDAKSTEM
looking good but not quite...the message starts all right but goes wierd after 20 some letter...I guess that is when the second wheel turned. Wrong timing due to wrong start position.
This means that to get the message right (at least untill the third wheel moves) I only need to find the right ring setting for the fast wheel and then the right start position (given that I have the right wheels in the right order). I will know I found it because it will give me the most caracters right in the text
This also means that for the beginning of the message (untill second wheel moves), the settings of the rightmost wheel - "Start A Ring D" or "Start B Ring E" or "Start C Ring F"......and so on will all have the same outcome.
This means that if the beginning of the message is no good with one of those, there is no use in testing the others....therfore eliminating a lot of possibilities (around 26 per wheel I suppose) and saving a lot of time.
With
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 E-05
Stecker: None
Start position ZYB
i get the 20 first caracters of the clear message right....and after a short gibberish output, it then becomes readable again......not so bad for something pretty far from the original settings.
With
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 Y-25
Stecker: None
Start position ZXV
Gives me 21 first caracters
With
UKW: B
Walzen: I II III
Ringstellung: A-01 A-01 D-04 (correct ring setting)
Stecker: None
Start position ZYA (correct start position)
I get, in this case, 99 first caracters correct.
I am pretty sure that once you have done it for the first wheel, you can attack the next in about the same way.
I cannot translate this in numbers and statistics, but I am sure this eliminates lots of possibilities (possibly more than the fact that a letter cannot encrypt to itself in my (humble) opinion) and gives a nice method to help search for the right key.
I am pretty sure that someone has thought of that before me and I probably reinvented the wheel here. (does this technique exist and have a name by any chance).
But I thought I'd share it anyway.