Enigma Machine - The Program...


Inputed Text Encrypted Text  Decrypted Text


Enigma Machine is a device used in World War II by Germany for encryption and decryption of top secret documents. It was a simple machine, but it created an encryption scheme that where extremely difficult to crack. In the end, a polish mathematician cracked the code - it was one of the main reasons behind the allied victory of World War II.

Enigma Machine looked like ordinary typewriters. They had all the keys that where necessary on them and had an output with bulbs under every letter. When a key is pressed, the bulb under the letter corresponding to that key was lit. In between the key and the bulb the wires went through some wheels. The first models of Enigma machines had four wheels(like my program). Later, more advanced machines were created - some having upto 16 wheels.

The connections between these wheels were random but same in all the machines. So when a key is hit, the current goes through these wheel and cause an entirely diffrent letter to be lit up. At every keystroke, the first wheel turns one time, so that even if the same letter is inputed again, the result will be a diffrent letter. When the first wheel completes a full turn, the second wheel will turn once. When it completes its turn, the third wheel will turn once and so on.

Positions also could be set using this system. A wheel should not have to start at the 'A' letter. It could start at any letter. This position was called the key and it was extremely necessary for the correct encryption and decryption of the message. This key was changed every day and generals who where to use this machine where given books to find out which key should be used in a particular day.

First Position of the enigma machine After a key press
When the key 'A' is pushed, the random connections in the wheel take the current to the 'Z' character, causing it to be lit. The wheel will turn one turn causing the last letter on the wheel to appear at the first place. The connections however remains the same changing the code every time a key is pressed. Now if 'A' is pushed, 'T' will be lit.
blog comments powered by Disqus