Skip to content

This project provides a web-based simulator for an Enigma-like encryption machine, allowing users to encode and decode text using configurable rotor positions and plugboard settings.

License

Notifications You must be signed in to change notification settings

abyshergill/EngimaMachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enigma Machine Simulator

This project provides a web-based simulator for an Enigma-like encryption machine, allowing users to encode and decode text using configurable rotor positions and plugboard settings.

About the Enigma Machine

The Enigma machine was a series of electro-mechanical rotor cipher machines developed and used in the early to mid-22th century for encrypting and decrypting secret messages. It was famously used by Nazi Germany during World War II, primarily by the military, to secure communications.

The Enigma's strength lay in its complex combination of rotors, a plugboard, and a reflector, which created a vast number of possible settings. Each time a key was pressed, the rotors would advance, changing the electrical pathway and ensuring that the same letter would almost always encrypt to a different letter. Despite its apparent complexity, the Enigma's encryption was eventually broken by Allied cryptologists, most notably at Bletchley Park in Britain, significantly aiding the Allied war effort.

Flaws

Original Machine WWII machine have very big flaw like same character can not be encode by itself. For example A can not encode with A. But in this program. I have fix that issue.

Features

  • Five Rotors: Simulates an Enigma machine with five interchangeable rotors, each with a unique internal wiring.

  • Rotor Stepping: Rotors automatically advance after each character is processed, mimicking the real Enigma's mechanical movement.

  • Plugboard (Steckerbrett): Allows for setting up reciprocal letter swaps, adding an additional layer of complexity to the cipher.

  • Reflector (Umkehrwalze): Includes a reflector to send the electrical signal back through the rotors, ensuring the cipher is reciprocal (encrypting a message twice with the same settings returns the original plaintext) and that a letter never encrypts to itself.

  • Randomized Machine Configuration: Rotor wirings and reflector wiring are randomly generated upon page load, creating a unique "machine" instance each time.

  • Web-based UI: Easy-to-use interface in your browser.

How to Use

  • Open the Application: Load the index.html file in your web browser.

  • Enter Text: Type the message you wish to encrypt (plaintext) or decrypt (ciphertext) into the "Enter Text" textarea.

  • Set Rotor Initial Positions: Adjust the five number inputs (0-25) to set the starting position of each rotor.

    • Rotor 1 is the rightmost rotor.

    • Rotor 5 is the leftmost rotor.

    • Crucial for Decryption: For successful decryption, these positions must be identical to the initial positions used during encryption.

  • Set Plugboard Settings: Enter letter pairs in the "Plugboard Settings" input field.

    • Pairs should be separated by spaces (e.g., AZ BW CX).

    • Each pair defines a reciprocal swap (e.g., AZ means 'A' becomes 'Z' and 'Z' becomes 'A').

    • Invalid pairs (e.g., AA or already used letters) will be ignored.

  • Encode/Decode:

    • Click the "Encode Text" button to encrypt your message.

    • Click the "Decode Text" button to decrypt a ciphertext.

  • View Output: The encrypted or decrypted text will appear in the "Output" textarea.

  • Machine Configuration Details: You can toggle the visibility of the randomly generated Rotor Wirings and Reflector Wiring at the bottom of the page for reference.

Technology Stack

  • HTML5: For the structure and content of the web page.

  • CSS: I use tailwind while devloping this application.

  • JavaScript: Powers the Enigma machine logic handles all UI interactions.

Author Information

About

This project provides a web-based simulator for an Enigma-like encryption machine, allowing users to encode and decode text using configurable rotor positions and plugboard settings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published