Is PBL Report
Is PBL Report
Project Report
Submitted on:
26/11/2024
TABLE OF CONTE
The Enigma Machine Simulator project recreates the encryption mechanics of the historical Enigma machine,
famously used during World War II. Built with Streamlit, this web-based application provides an intuitive and
interactive interface to encode messages securely. Users can customize encryption settings such as rotor models,
reflector types, and rotor starting letters, mimicking the operational intricacies of the original machine. This
simulator serves educational and didactic purposes, allowing users to explore cryptography concepts while
offering a functional platform for encryption. Python is utilized for implementing the encryption logic, ensuring
accuracy and reliability in simulating the machine’s behavior.
OBJECTIVES
Modern cryptography concepts stem from historical encryption methods like those of the Enigma machine.
However, accessible tools to understand and interact with such systems are limited. This project bridges that
gap by creating a simulator to demonstrate the workings of a foundational cryptographic device. The challenge
of this project was to accurately simulate the encryption process of the Enigma machine, a device that played
a pivotal role in secure military communications. The Enigma machine used multiple rotors and a reflector to
encrypt messages, and the difficulty lay in faithfully recreating the interactions between these components.
Additionally, it was essential to make the simulator user-friendly, allowing users to easily customize rotor
configurations and encrypt their own messages.
Exploring historical cryptography is crucial for comprehending the evolution of modern secure
communication techniques. Simulating the Enigma machine provides an engaging platform for enthusiasts,
educators, and students to delve into encryption principles while paying tribute to its historical importance.
This problem is significant because the Enigma machine was a symbol of cryptographic ingenuity and wartime
communication security. Understanding how it worked offers insight into early encryption methods and
highlights the importance of secure communication in military operations. Recreating the Enigma machine
allows us to appreciate the complexity of historical cryptography, and the challenges faced by cryptanalysts
who eventually cracked the Enigma code, contributing to the outcome of World War II.
TOPICS OF LAB USED
o How? The Enigma machine employs a form of transposition cipher, where the order of
letters in the alphabet is shifted and scrambled through rotor rotations. While not exactly a
Caesar cipher, the shifting mechanism used in the Enigma machine is conceptually similar
to transposition-based ciphers.
o How? The Enigma machine operates on a substitution cipher model, where each letter in
the plaintext is substituted for another letter based on the rotor settings. This is similar to
polyalphabetic ciphers, where multiple cipher alphabets are used for encryption.
o How? The Enigma machine is an example of symmetric key cryptography, where the same
settings (rotor positions and configurations) are used for both encryption and decryption.
Both the sender and receiver must share the same key to encrypt and decrypt the messages.
o How? While the Enigma machine itself does not directly use the Diffie-Hellman algorithm,
the concept of securely exchanging keys is central to encryption. The project conceptually
touches on this by requiring the same settings (rotor configuration and starting letters) for
both encryption and decryption.
FLOWCHART
SOURCE CODE
CODE OUTPUT
IMPLEMENTATION DETAILS
Message Preprocessing:
• Input message is converted to uppercase and spaces are removed to match Enigma's requirements.
Encryption Logic:
• Letters are passed through rotors and reflectors for encryption, following Enigma’s steps: rotor
substitution → reflection → rotor backtracking.
• Rotors rotate after each letter to ensure dynamic encryption.
Rotor Rotation:
• The first rotor rotates after each letter, the second after the first completes a full rotation, and so on,
simulating Enigma's rotation mechanism.
Encrypted Output:
• The encrypted message is displayed immediately after the user inputs their message and selects
settings.
• To decrypt, users must enter the encrypted message with identical settings.
Visual Aids:
• Image of the Enigma machine is displayed to visually connect users to the historical context.
1) Z. Hu, B. Liu, X. Ren and Y. Tang, "Analysis and Implementation of the Enigma Machine," 2022
International Conference on Big Data, Information and Computer Network (BDICN), Sanya, China, 2022,
pp. 475-480, doi: 10.1109/BDICN55575.2022.00093.
2) H. Ziegler, "Breaking the Enigma: A Comprehensive Analysis of the Enigma Machine and Its
Cryptographic Techniques," 2021 IEEE International Conference on Cryptography and Data Security
(ICCDS), New York, USA, 2021, pp. 220-225, doi: 10.1109/ICCDS51468.2021.00042.
3) D. M. Sutherland, "The Enigma Machine and Its Impact on World War II," 2019 International
Symposium on Information Security and Cryptography (ISISC), Tokyo, Japan, 2019, pp. 102-107, doi:
10.1109/ISISC47369.2019.00039.