![]() I've not written any kind of command line parsing here.Similarly, in the brute force key search code, for simplicity I create new enigma machines as required rather than implementing a number of specific reinitialisation functions that would be faster.I've managed to get the code to break a message in under 4 seconds on one of our servers! I'm keeping this code separate to the main branch to keep the main branch clean and based off the original video. I've added a more optimised and multi-threaded version in a branch called optimised.Modern compilers will optimise a lot of it anyway. I used classes and functions rather than doing things inline, for example. This said, I didn't worry too much about speed, it's plenty fast enough. The code is fairly efficient, Enigma boils down to a lot of array indexing into different rotors.Fix all settings, and then use a hill climbing approach to find the best performing plugboard swaps, again measured using a fitness function.You do not have to use the same fitness function as before. Fix the rotors, and iterate through all possible ring settings for the middle and right rotors, again testing the fitness of the decryption. ![]() Save the best performing rotor configuration. ![]() For each decryption, measure the text fitness using one of the available fitness functions.
0 Comments
Leave a Reply. |