The Enigma Machine consisted of a wooden cabinet enclosing a typewriter keyboard and a set of 26 lamps (one for each letter of the alphabet). At the top of the machine was a slot into which three wheels or rotors could be fitted onto a shaft.
The rotors were furnished with electrical contacts and buried inside were wires that connected the contacts on one side to those on the other in a scrambled order. The cabinet contained a battery, and when a key was pressed, electric current would flow from the keyboard through each of the three rotors in turn, through a reflector, then back through the rotors, and finally through one of the lamps making it light up.
A number of different rotors were available (8 in this case) and the operator would choose which rotors to use and the order in which to use them. The operator could also select which reflector to use (2 were available).
The rotors had adjustable rings which could be turned with respect to the inner core. The ring for each rotor could be set by the operator in any one of 26 possible positions (A to Z).
The initial positions of the rotors could also be set by the operator according to which letters on their rims showed through a window in the machine.
On the front of the cabinet was the plug board which consisted of a set of 26 sockets into which wires with plugs at both ends could be inserted. Its effect was an additional swapping of pairs of letters and hence added a further level of scrambling to the encryption process.
The cumulative effect of rotating rotors, rings, reflector and plugs meant that the number of possible different configurations of the machine was absolutely enormous. It was considered therefore to be a very secure method of encrypting messages (it was thought unbreakable in fact though this proved not to be the case).
As each key on the keyboard was pressed one of the lamps would light up (obviously not the same letter that had been pressed). It was the operator's job to write down which lamps lit up.
As keys were pressed the rotors would also rotate. This meant that the same letter of the alphabet would be encoded to a different letter each time it was used in a message. (If this weren't the case it would have been almost trivial to crack an Enigma message.) Effectively each letter in a message was encoded using its own unique code. It was this fact that made the Enigma so difficult to defeat. It took some of the best mathematical brains in Europe to beat it and doing so was the spur that led to the development of modern electronic computers.
The reciprocal nature of the design meant that if the letter A were encoded into, for example, a B at some point in a message, then a B would be encoded into an A at the same point. Consequently encoding and decoding were the same process, they were reversible. If encoded 'ciphertext' were passed through the machine again the result would be the original message or 'plaintext' (provided of course that the machine was set up in the same way).
One further consequence of the design was that a letter would never encode to itself. This proved to be the Enigma's Achilles' Heel.
The design
This is a re-working of an earlier design that used a 5x7 dot matrix display to show the encrypted and decrypted letters. That design employed a PS/2 keyboard for character entry. At the time PS/2 keyboards were still quite common with most PC owners having one at the back of a cupboard. Nowadays they are rare having been universally replaced by USB keyboards. So it was time for an upgrade.
The PS/2 keyboard protocol is much simpler than the USB keyboard protocol and can easily be handled by an 8-bit microcontroller in software. USB however really needs hardware support.
Technology moves on and small LCD displays are now very affordable (especially when ordered from AliExpress). The particular display used had a resolution of 240 x 240 pixels with 16-bit colour and an SPI interface. ...
Read more »