The program will reproduce the file outputting to "test1.txt" with the enciphered string(s) appended. Please note the expectation that the text file will be named "test0.txt" (or similar). Here's the code, followed by a sample text file containing a few configurations and messages. Some may know that the Kriegsmarine's 4 rotor design allows the user to, with special settings, operate as a 3 rotor version. In the case of the former, the 4th rotor in this code operates as a simple pass-through operation (without substitution). This simulates both a 3 rotor and a 4 rotor (Kriegsmarine) Enigma. Then, the actual character substitution of each input character is an almost trivial cascade of table lookup operations. From the configuration settings, "the device" is initialised its rotors (with 'ringstellung'), its reflector and its plugboard. Instead of repeated modular divisions, rotors, the reflector and the plugboard are "in triplicate", automatically "wrapping 'round" as a circular rotor would do. What sets this apart from the pack (IMO) is that this Enigma "machine" configuration and message are loaded from a text file that can contain multiple separate configurations & messages. With some minor tweaking, I'm fairly sure a modern C compiler would be content. The code has been compiled with an ancient C++ compiler for the niceties of declaring/defining variables as needed. Running this up the flagpole to "put it out there".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |