{"id":22039259,"url":"https://github.com/panagiotiskots/enigma-machine-simulator","last_synced_at":"2025-06-27T11:38:34.014Z","repository":{"id":248823220,"uuid":"829887618","full_name":"PanagiotisKots/Enigma-Machine-Simulator","owner":"PanagiotisKots","description":"A C-based simulation of the Enigma machine encryption process","archived":false,"fork":false,"pushed_at":"2024-09-07T13:34:20.000Z","size":395,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T19:17:14.777Z","etag":null,"topics":["c","cryptography","encryption","encryption-algorithms","encryption-decryption","enigma","enigma-machine","enigma-simulator","history"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PanagiotisKots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-17T07:34:02.000Z","updated_at":"2024-09-14T11:47:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea850b82-c497-4ec9-9533-54f6b225a9ca","html_url":"https://github.com/PanagiotisKots/Enigma-Machine-Simulator","commit_stats":null,"previous_names":["panagiotiskots/enigma-machine-simulator"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PanagiotisKots%2FEnigma-Machine-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PanagiotisKots%2FEnigma-Machine-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PanagiotisKots%2FEnigma-Machine-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PanagiotisKots%2FEnigma-Machine-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PanagiotisKots","download_url":"https://codeload.github.com/PanagiotisKots/Enigma-Machine-Simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104529,"owners_count":20561380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cryptography","encryption","encryption-algorithms","encryption-decryption","enigma","enigma-machine","enigma-simulator","history"],"created_at":"2024-11-30T11:10:01.009Z","updated_at":"2025-03-23T13:13:50.730Z","avatar_url":"https://github.com/PanagiotisKots.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛡️ Enigma Machine Simulator\n\nA C-based simulation of the Enigma machine encryption.\n\nThe Enigma machine is one of the most famous encryption devices in history, used extensively by Nazi Germany during World War II. It became a symbol of cryptographic warfare due to the significant efforts made by the Allies to crack its codes.\n\n---\n\n## 🛠️ Early Development\n\n### 🔨 Invention\n\n- **Inventor**: German engineer Arthur Scherbius.\n- **Year**: Patented in 1918, shortly after World War I.\n- **Purpose**: Initially designed for commercial use to secure corporate communications.\n\n### 💼 Commercial Models\n\n- **1920s**: Early commercial Enigma models marketed to banks and businesses.\n- These models weren’t commercially successful but demonstrated the potential of mechanical encryption devices.\n\n---\n\n## ⚔️ Military Adoption\n\n### 🪖 German Military Interest\n\n- By the **late 1920s** and **early 1930s**, the German military recognized Enigma’s potential for secure communications.\n- The military **modified** and enhanced the machine to increase security, adding:\n  - Additional **rotors**.\n  - The **plugboard** for added complexity.\n\n### 🌍 Usage During WWII\n\n- Enigma became the **primary encryption device** for the German **Army**, **Navy**, **Air Force**, and intelligence services.\n- It was believed to be **unbreakable** due to its **complex encryption methods**.\n\n\n\n\n\n\n\n\n\n\n## 🔧 The Enigma Machine Design\n\n| **Component**                 | **Description**                                                                     |\n|-------------------------------|-------------------------------------------------------------------------------------|\n| ⚙️ **Rotors (Wheels)**         | Rotating disks that scrambled the input letters.                                     |\n| 🔄 **Reflector (Umkehrwalze)**  | Reflected signals back through the rotors, ensuring bidirectional encryption.        |\n| 🔌 **Plugboard (Steckerbrett)** | Allowed additional letter substitutions for extra complexity.                       |\n| ⌨️ **Keyboard**                | Used by the operator to type plaintext messages.                                     |\n| 💡 **Lampboard**               | Lit up the encrypted letters in response to each keypress.                          |\n\n### ⚙️ Operation\n\n- Each keypress caused the rotors to move, altering the encryption path for each letter.\n- The plugboard provided an additional layer of substitution before and after the signal passed through the rotors.\n\n---\n\n## 🧠 Breaking the Enigma\n\n### 🇵🇱 Polish Efforts\n\n- The first major breakthroughs in cracking Enigma came from **Polish cryptanalysts** in the 1930s.\n- Mathematicians **Marian Rejewski**, **Jerzy Różycki**, and **Henryk Zygalski** applied mathematical techniques to study the Enigma’s structure.\n- They built early mechanical devices, such as the \"**bombe**\", to help decipher Enigma messages.\n\n### 🇬🇧 Transfer to the Allies\n\n- In **1939**, just before World War II, Polish cryptanalysts shared their knowledge with **British** and **French intelligence services**.\n- This transfer was crucial for further Allied code-breaking efforts.\n\n### 🏰 Bletchley Park\n\n- During World War II, **Bletchley Park** became the hub of Allied cryptanalysis.\n- **Alan Turing**, along with **Gordon Welchman** and others, developed advanced versions of the **bombe** machine to automate the decryption of Enigma-encoded messages.\n\n### 🕵️ Impact on the War\n\n- The successful decryption of Enigma-encoded messages, known as \"**Ultra**\" intelligence, gave the Allies insight into German military operations.\n- Historians widely believe that Ultra **shortened the war** and saved countless lives.\n\n\n\n\n\n## 📜 Post-War and Legacy\n\n### 🔒 Secrecy and Declassification\n\n- The work at **Bletchley Park** remained highly classified until the **1970s**.\n- The full extent of the Enigma and code-breaking efforts was not revealed to the public until much later.\n\n### 🏛️ Historical Significance\n\n- The **Enigma machine** has become an iconic symbol in the history of **cryptography** and **warfare**.\n- Its story has been the subject of numerous **books**, **documentaries**, and **films**, showcasing the intersection of **technology**, **mathematics**, and **military intelligence**.\n\n### 📚 Additional Resources\n\n- Learn more about **Alan Turing** and the efforts to crack the Enigma code: [**Bletchley Park**](https://bletchleypark.org.uk)\n- For an in-depth look at the mathematics behind the Enigma: [**The Bombe Machine**](https://en.wikipedia.org/wiki/Bombe)\n\n---\n\nThe **Enigma machine** remains a monumental feat of encryption technology and a critical turning point in the history of cryptography. Its story not only highlights the challenges of secure communications but also the power of human ingenuity in solving complex problems.\n\n\n\n\n\n\n\n\n\n# The Programm\n\nA **C-based simulation** of the historic Enigma machine, demonstrating the encryption process used in this iconic ciphering device. The simulator replicates the step-by-step mechanics of the original machine, allowing users to follow each encryption stage in detail.\n\n## 🔑 Features\n\n- **Full Enigma encryption simulation** including rotor and reflector behavior.\n- **Detailed step-by-step output**, displaying the encryption process for each letter.\n- **Customizable rotor positions** for flexible configurations and experimentation.\n- Easy-to-follow structure with **explanations of each encryption stage** in the output.\n\n## 🛠️ Installation\n\n1. **Clone the repository**:\n\n\n   git clone https://github.com/PanagiotisKots/Enigma-Machine-Simulator.git\n\n    Navigate to the project directory:\n\n\n\ncd Enigma-Machine-Simulator\n\nCompile the code:\n\n\n\n    gcc -o enigma Enigma.c\n\n🚀 Usage\n\nTo run the Enigma machine simulation:\n\n\n\n./enigma.exe\n\nThe program will prompt you to enter a message, after which it will display a step-by-step encryption process and the final encrypted message.\n⚙️ How It Works\nKey Components\n\n    Rotors: Rotating disks that map input letters to other letters. Their positions shift with each key press, dynamically changing the encryption path.\n    Reflector: Reflects the signal back through the rotors, adding a second encryption pass.\n    Plugboard: (Not implemented in this version) Would allow additional letter substitutions for even greater complexity.\n\nEncryption Process\n\n    Forward Pass Through Rotors: Each input letter is passed through the sequence of rotors, with the rotor positions shifting based on prior encryptions.\n    Reflection: The letter is then reflected back through the rotors, further scrambling the signal.\n    Backward Pass Through Rotors: The reflected letter is passed again through the rotors in reverse order.\n    Rotor Stepping: After each letter, the rotors step, changing their positions and modifying the encryption for the next input.\n\nExample Encryption Output\n\nThe program prints out detailed steps for each character's encryption:\n\n\nEncrypting character: A\nInitial Rotor Positions: [0, 0, 0]\nAfter Rotor 1: E\nAfter Rotor 2: K\nAfter Rotor 3: Z\nAfter Reflector: R\nBack through Rotor 3: X\nBack through Rotor 2: P\nBack through Rotor 1: G\nEncrypted character: G\n\n🔄 Rotor Positioning\n\nThe rotor stepping mechanism advances the rotors after each key press, creating a different encryption pattern for each character. You can reset the rotor positions manually or modify them for specific use cases, providing flexibility in your encryption tests.\n🧠 Customization\n\nYou can easily customize the rotor configurations and starting positions by modifying the code, making it possible to explore different encryption patterns and behaviors.\n\n\n\n\n\n\n\n| 🛠️ **Feature**              | 💡 **Difficulty Level** | 📈 **Complexity**    | 🧠 **Breaking Difficulty** |\n|-----------------------------|-------------------------|----------------------|----------------------------|\n| ⚙️ **Rotors Mechanism**      | 🟢 Basic Implementation | 🔹 Moderate          | 🟡 Medium                   |\n| 🔄 **Rotor Stepping**        | 🟡 Intermediate         | 🔸 High              | 🟠 Challenging              |\n| 🔌 **Plugboard (Steckerbrett)** | 🔴 Advanced            | 🔻 Very High         | 🔴 High                     |\n| 🔁 **Reflector (Umkehrwalze)** | 🟢 Basic Implementation | 🔹 Moderate          | 🟠 Challenging              |\n| 🔍 **Encryption Process**    | 🟡 Intermediate         | 🔸 High              | 🟠 Challenging              |\n| 🧮 **Mathematical Model**    | 🔴 Advanced            | 🔻 Very High         | 🔴 High                     |\n| 🔐 **Overall Decryption**    | 🔴 Very Advanced       | 🔻 Complex           | 🔴 Very High                |\n\n\n\n\n\n| 🛠️ **Component**            | 📸 **Image**                                                         | 📄 **Description**                                                                                 |\n|-----------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|\n| ⚙️ **Enigma Machine**       | ![Enigma Machine](https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Enigma_%28crittografia%29_-_Museo_scienza_e_tecnologia_Milano.jpg/220px-Enigma_%28crittografia%29_-_Museo_scienza_e_tecnologia_Milano.jpg)            | The full Enigma machine, showing the rotors, reflector, and plugboard.                          |\n| 🔄 **Rotors**               | ![Rotors](https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Enigma_rotors_with_alphabet_rings.jpg/220px-Enigma_rotors_with_alphabet_rings.jpg)                     | The rotating disks (rotors) that scramble the input letters.                                     |\n| 🔌 **Plugboard (Steckerbrett)** | ![Plugboard](https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Enigma-plugboard.jpg/220px-Enigma-plugboard.jpg)              | The plugboard used for additional letter pair substitutions.                                     |\n| 🔁 **Reflector (Umkehrwalze)** | ![Reflector](https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Enigma_insides.agr.jpg/220px-Enigma_insides.agr.jpg)              | The reflector that sends the electrical signal back through the rotors.                         |\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanagiotiskots%2Fenigma-machine-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanagiotiskots%2Fenigma-machine-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanagiotiskots%2Fenigma-machine-simulator/lists"}