VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Enigma Encryption Example

by Mark Robert Strange (3 Submissions)
Category: Encryption
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

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 its 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. I am no mathmatician, so if anyone
can tell me the possible combinations, I would appreciate it.
When the Germans used this machine, it baffled the Allies, who frantically tried to break it with
no success. It wasnt until a German 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.
The U-Boat was scuttled and the crew was kept in a top secret location. The U-Boat was simply
considered lost during battle and Germans continued the war not knowing the truth.
When the war in the Atlantic turned for the worse, the Germans, who believed their code to be
unbreakable, believed that there were spies in their top level officials. They never considered
that the code was being decrypted through a captured machine, so as a result, they set up
elaborate networks to try and find these "spies". Paranoia being what it was, many loyal
German officers were tortured and murdered for treason, even though they had commited no such
offense.
This code is by no means complete. I will try and enhance its speed and toughen its encryption
even further. Ill also try and build a better sample app with more features. If you find a
problem or have a suggestion, I would love to hear it.
This program has now been updated to reflect many of the suggestions posted here. Thanks for some great feedback and keep coding! =)

Assumes
Unzip and run!

Rate Enigma Encryption Example

Upload

Download this snippet    Add to My Saved Code

Enigma Encryption Example Comments

No comments have been posted about Enigma Encryption Example. Why not be the first to post a comment about Enigma Encryption Example.

Post your comment

Subject:
Message:
0/1000 characters