Program that simulates the behaviour of an Enigma Machine.
In this solution, the logical flow of the encryption of a letter is exactly the same as in a real Enigma Machine. In other words, we could say that the encryption method is exactly the same, but made through software instead of hardware. (See image in Other resources)
- Encrypt and decrypt messages simetrically
- Modify the rotors configuration
- Choose 3 out of 5 rotors
- Change the position of any rotor
- Modify the plugboard configuration
The Object-Oriented design allowed for a neat level of abstraction, facilitating the usage of the Enigma Machine object. The encryption/decryption of a letter can be achieved through a method:
string outLetter = machine.EncodeLetter("a")
Enigma's Logical Flowchart:
Numberphile's video explains how the Enigma Machine works and provides some background history.