Home Page The Sigaba Home Page |
DescriptionI created a simulator of the Siagaba cipher machine. It works in text mode (TUI interface). It is written in Python and only uses the standard library. Consequently, it works on any platform on which the Python 3.x interpreter is installed (Windows, Linux, Mac-OS-X, etc.). InstallationMy simulator is in the form of a TARBALL: a compressed TAR file. Just download it from my website and then untar it. Example : C:\> curl -O http://www.jfbouch.fr/crypto/sigaba/sigabajf.tar C:\> tar xf sigabajf.tarAfter decompression, we obtain a file tree which starts at the sigabajf directory. Show the syntaxJust use the -h option to display the syntax. We start by moving to the root directory of the software. C:\>cd sigabajf C:\sigabajf>dir /w Le volume dans le lecteur D s’appelle DATA Le numéro de série du volume est 9A86-5488 Répertoire de D:\TMP\sigabajf [.] [..] [LOGS] [MSGS] README.md RotorBiFace.py RotorIndx.py [ROTORS] sigaba.py sigaba_tui.py Syslog.py ... C:\sigabajf>python sigaba_tui.py -h Usage: Syntax: sigaba_tui.py [option...] Example: echo AAAAAAAAAAAAAAAA | python sigaba_tui.py \ -m CSP-889 \ -s ECM \ -I 00R:01:02:03:04R=05:06:07R:08:09=10:20:30:40:50 \ -E ABCDE:FGHIJ:01234 \ -c [Expected: JTSCA LXDRW OQKRX] -h Help -D prefix DEBUG, if prefix equal LOG, use STDOUT -m model CSP-889 by default (it exists also the CSP-2900 model) -s set The set of rotors (ECM by default) -I internal Internal Key, by default: 00:01:02:03:04=05:06:07:08:09=10:20:30:40:50 If the rotor is in Reverse position, it is followed by 'R' Example: 00:01R:02:03R:.... Separators: Note: If you activate the program without option, it reads standard input. We must interrupt it with Ctrl-C or terminate standard input (via Ctrl-D on Unix or Ctrl-Z on Windows). A simple exampleTo encrypt text, use the “-c” option. Plain text is read from standard input. For example, we want to encrypt the text HELLOWORLD. C:\sigabajf> echo HELLOWORLD | python sigaba_tui.py -c FLQGF ONNOE O C:\sigabajf> echo HELLOWORLD > MSGS\plain.txt C:\sigabajf> more MSGS\plain.txt HELLOWORLD C:\sigabajf> python sigaba_tui.py -c < MSGS\plain.txt FLQGF ONNOE ONote: The Microsoft Windows system adds a space, which here is coded by the letter O. There is no additional character under Unix. To decrypt a text, we use the “-d” option. C:\sigabajf> echo FLQGF ONNOE O |python sigaba_tui.py -d HELLOWORLDHere are the default values used in the previous examples: Model: CSP-889 Rotors set: ECM Mode: ENCRYPT Reset Mode: OPERATE Rotor 00,0,YCHLQSUGBDIXNZKERPVJTAWFOM Rotor 01,0,INPXBWETGUYSAOCHVLDMQKZJFR Rotor 02,0,WNDRIOZPTAXHFJYQBMSVEKUCGL Rotor 03,0,TZGHOBKRVUXLQDMPNFWCJYEIAS Rotor 04,0,YWTAHRQJVLCEXUNGBIPZMSDFOK Rotor 05,0,QSLRBTEKOGAICFWYVMHJNXZUDP Rotor 06,0,CHJDQIGNBSAKVTUOXFWLEPRMZY Rotor 07,0,CDFAJXTIMNBEQHSUGRYLWZKVPO Rotor 08,0,XHFESZDNRBCGKQIJLTVMUOYAPW Rotor 09,0,EZJQXMOGYTCSFRIUPVNADLHWBK Rotor 10,0,7591482630 Rotor 20,0,3810592764 Rotor 30,0,4086153297 Rotor 40,0,3980526174 Rotor 50,0,6497135280 Key: OOOOO OOOOO 00000 The example given when displaying the syntax
C:\sigabajf> echo AAAAAAAAAAAAAAA | python sigaba_tui.py ^ -m CSP-889 -s ECM ^ -I 00R:01:02:03:04R=05:06:07R:08:09=10:20:30:40:50 ^ -E ABCDE:FGHIJ:01234 -c JTSCA LXDRW OQKRXNote: Under the command interpreter it is possible to enter a command on several lines. With the Unix shell, just enter the "\" character before validating. The command prompt changes to ">". With the Windows CMD tool, simply enter the "^" character. The command prompt changes to "Plus ?". Here is the corresponding configuration:
Example : C:\sigabajf> more ROTORS\ECM\00.rot YCHLQSUGBDIXNZKERPVJTAWFOM Alpha wheel 0 C:\sigabajf> more ROTORS\ECM\10.ri 7591482630 Rotor Index 10 DebuggingIt is possible to obtain debugging information using the “-D” option followed by a word. If this word is "LOG", the Debugging information will be visible on the screen. If this is not the case, a log file is created in the LOGS directory and whose prefix corresponds to the word following option D. WARNING! The log is very detailed. It can only be used if very few letters (1,2 or 3) are encrypted (or deciphered), otherwise the log becomes enormous. Here is an example:
C:\sigabajf> echo THE ZEBRE | python sigaba_tui.py -m CSP-2900 -s ECM ^ -I 08R:02:05R:09:01=07:00R:04:03:06R=30R:10:50R:40:20 ^ -E MERDE:SHITS:01789 -c -D MRD ZTABW AULD C:\sigabajf> echo ZTABW AULD | python sigaba_tui.py -m CSP-2900 -s ECM ^ -I 08R:02:05R:09:01=07:00R:04:03:06R=30R:10:50R:40:20 ^ -E MERDE:SHITS:01789 -d -D MRD2 THE XEBREHere is the start of the log file (LOGS\MRD_log.txt): DEBUG 7 9507 ---Starting Logging---- INFO 6 9507 kargs:{'debug': True, 'ident': 'MRD', 'rep': 'ECM', 'model': 'CSP-2900', 'mod e': 3, 'intKey': ['08', '02', '05', '09', '01', '07', '00', '04', '03', '06', '30', '10', '50', '40', '20'], 'verse': [1, 0, 1, 0, 0, 0, 1, 0, 0, 1], 'verseIdx': [1, 0, 1, 0, 0]} NOTICE 5 9507 Mode: ENCRYPT INFO 6 9507 Model: CSP-2900 INFO 6 9507 Rotors set: ECM INFO 6 9507 Mode: ENCRYPT INFO 6 9507 Reset Mode: OPERATE INFO 6 9507 Rotor 08,1,XHFESZDNRBCGKQIJLTVMUOYAPW INFO 6 9507 Rotor 02,0,WNDRIOZPTAXHFJYQBMSVEKUCGL INFO 6 9507 Rotor 05,1,QSLRBTEKOGAICFWYVMHJNXZUDP INFO 6 9507 Rotor 09,0,EZJQXMOGYTCSFRIUPVNADLHWBK INFO 6 9507 Rotor 01,0,INPXBWETGUYSAOCHVLDMQKZJFR INFO 6 9507 Rotor 07,0,CDFAJXTIMNBEQHSUGRYLWZKVPO INFO 6 9507 Rotor 00,1,YCHLQSUGBDIXNZKERPVJTAWFOM INFO 6 9507 Rotor 04,0,YWTAHRQJVLCEXUNGBIPZMSDFOK INFO 6 9507 Rotor 03,0,TZGHOBKRVUXLQDMPNFWCJYEIAS INFO 6 9507 Rotor 06,1,CHJDQIGNBSAKVTUOXFWLEPRMZY INFO 6 9507 Rotor 30,1,4086153297 INFO 6 9507 Rotor 10,0,7591482630 INFO 6 9507 Rotor 50,1,6497135280 INFO 6 9507 Rotor 40,0,3980526174 INFO 6 9507 Rotor 20,0,3810592764 INFO 6 9507 IKey: 01789 NOTICE 5 9507 Key: MERDE SHITS 01789 NOTICE 5 9507 ---> 0000: code <T> NOTICE 5 9507 Encrypt:T>V:H:K:O:Z:>Z DEBUG 7 9507 Current Injection DEBUG 7 9507 Rotors ctrl input: 345678 DEFGHI DEBUG 7 9507 D>E:R:L:L:J:>J DEBUG 7 9507 E>Y:O:T:X:G:>G DEBUG 7 9507 F>Z:G:Q:S:E:>E DEBUG 7 9507 G>X:T:I:V:R:>R DEBUG 7 9507 H>I:M:F:A:W:>W DEBUG 7 9507 I>S:S:V:U:Q:>Q DEBUG 7 9507 Rotors ctrl output: 00001010010000001100001000 DEBUG 7 9507 Rotors index input : 0001110010 DEBUG 7 9507 3>18529 DEBUG 7 9507 4>72160 DEBUG 7 9507 5>51741 DEBUG 7 9507 8>33673 DEBUG 7 9507 Rotors index output: 1101000001 DEBUG 7 9507 Advance cipher rotors: [1, 0, 0, 1, 1] DEBUG 7 9507 Advancement of control rotors NOTICE 5 9507 Key: NERED SHHTS 01789 NOTICE 5 9507 ---> 0001: code <H> NOTICE 5 9507 Encrypt:H>C:V:D:C:T:>TRemarks :
$ echo HELLO | python3 sigaba_tui.py -c -D LOG |awk '$2 < 6' NOTICE 5 4305 Mode: ENCRYPT NOTICE 5 5309 Key: OOOOO OOOOO 00000 NOTICE 5 5357 ---> 0000: code Advanced modesMy simulator supports advanced capabilities of Sigaba: the Navy's indicator method for specifying the starting key of 26-contact rotors and also tandem mode operation. C:\sigabajf>echo HELLOWORLD |python sigaba_tui.py -c -N MERDE CJUOD AARIV J C:\sigabajf>echo HELLOWORLD |python sigaba_tui.py -c | python sigaba_tui.py -d HELLOWORLD Web Links
|