evil_konijn zei:
v ook
Here is the concept behind this representation of the Enigma Machine:
The program uses virtual "wheels" that contain all of the printable characters on the keyboard.
Think of the first wheel as the keyboard you are typing on. All of the wheels contain the same
characters, but in a random, non-repeating order.
Each time a character is pressed, the location of that character on the one wheel is used to
as the index to lift the character off of the next wheel. Then the new character is searched for
in the next wheel, and the pattern repeats itself across each wheel. The character lifted off of
the final wheel is the output.
This step is repeated for each character in the message. Decryption simply sends the message
backwards through a similar, but reversed process.
What really makes this encryption effective is that like the real life machine, the wheels
rotate either to the left or right after each character. So the relationship between each
character shifts constantly. As a result, even repeating characters such as "AAAAAAAAAAAAA"
are represented with garbage such as "@n~WPnHv(.)z#"
Another great part about an encryption scheme like this is it's flexibility. You can add more
wheels, more characters per wheel, change the order of the wheels, the directions the wheels
spin, and change the starting position of each wheel.
So, unless somone can figure out:
1) How many wheels are being used...
2) How many characters are on each wheel...
3) The order of the wheels...
4) The direction they spin...
5) The initial position of each wheel...
6) The order of the characters on each wheel...
It would be virtually impossible to look at the encrypted characters and determine their
relationship to one another. There are so many possibilities and combinations of the above
criteria, it would have to be solved through brute force.
When the Nazis used this machine, it baffled the Allies, who tried to break it with
no success. It wasn't until a Nazi U-Boat was forced to surface in a naval battle and was
captured that the Allies got a huge break. An Enigma machine was captured along with a code book
that showed the information needed to decrypt the messages.