Assignment Report
Assignment Report
Name:
Student ID:
Page 1 of 9
CIS2201 - Cyber Security
1. System design
Introduction:
During World War II, the Enigma machine was a type of encryption technology that saw
widespread use. The Allies exerted a significant deal of effort in order to decipher the
encrypted signals sent by the German military, which utilized this method to protect its
communications. The machine functions on the principle of a set of rotors that jumble the
input message and a plugboard that modifies the characters in other ways. The computer had
a code that, at the time, was thought to be exceedingly safe. However, due to a number of
causes, including mistakes made by humans and developments in technology, the code was
finally cracked.
During World War II, the German military made use of the Enigma machine to encrypt and
decrypt secret messages. Because it was so difficult to crack, the German military depended
on the machine as their primary means of keeping their communications private. The input
message was garbled as a result of the machine's rotors, which had a variety of letter
sequences. The message would initially be scrambled before being reflected back through the
rotors and then out the other end, where it would be encoded. After several years of service,
the Enigma machine was finally deciphered by Allied cryptographers, notably Alan Turing.
In the next report, we will go over a simulation program that was used for the Enigma
machine. Because it is written in C, the software can be executed on any computer that has a
C compiler installed. Users are able to enter a message as well as a set of encryption
parameters, and it then generates the encrypted version of the message. The program is
Page 2 of 9
CIS2201 - Cyber Security
Page 3 of 9
CIS2201 - Cyber Security
2. Implementation notes
This is a C program that simulates the encryption and decryption of messages using an
Enigma machine, a machine used by the Germans during World War II for the encryption of
military communications. The program takes a message and a set of encryption parameters as
Page 4 of 9
CIS2201 - Cyber Security
The program implements the Enigma machine as a series of rotors that can be configured in a
certain order, each with a certain ring setting and initial position. The rotors encode the
message character by character, and the output of the last rotor is passed through a reflector
Page 5 of 9
CIS2201 - Cyber Security
before being encoded again by the rotors in reverse order. The output of the final rotor is the
encoded character. The rotor positions are advanced after each character is encoded.
The encryption parameters include the order of the rotors, the ring settings of the rotors, the
initial position of the rotors, and the plugboard settings, which allow pairs of characters to be
The program defines a Params struct to hold the encryption parameters and defines a
scramble function that takes a character and the encryption parameters and returns the
encoded character. The encode function takes a message and the encryption parameters and
The main function of the program prompts the user to enter the message to encode/decode
and the encryption parameters, sets default encryption parameters, and calls the encode
function to encode the message with the given parameters. The encoded message is then
3. Testing
This test case sets the encryption parameters and uses the encode function to encrypt the
message "HELLO WORLD". The expected result after encryption is "ILBDA KRMSK". The
test case then checks if the encrypted message is equal to the expected result using the assert
function. If the check fails, the program will terminate with an error message.
Page 6 of 9
CIS2201 - Cyber Security
4. Reflective analysis
This program implements an encryption scheme based on the Enigma machine used by the
Germans in World War II. The program takes a message and encryption parameters as input,
and outputs the encoded message. The encryption parameters include the order of the rotors,
the ring settings, the initial rotor positions, and the plugboard settings.
The main function first sets default parameters for the encryption, then prompts the user to
enter a message to encode/decode, as well as the encryption parameters. The message and
parameters are passed to the encode function, which uses the scramble function to encode
each character in the message. The scramble function takes a character and the encryption
The scramble function first checks if the input character is a uppercase alphabetic character.
If not, it returns the input character unchanged. Otherwise, it advances the rotor positions
according to the current rotor order and the notch positions on the rotors. It then applies the
plugboard settings to the character, and processes the character through each rotor in the
Page 7 of 9
CIS2201 - Cyber Security
current order. The processing involves shifting the character by the current rotor position and
the ring setting, mapping the character to the corresponding character in the rotor substitution
table, and then shifting the character back by the same amount. After the character passes
through all rotors, it is mapped to a character in the reflector table, and then processed again
through the rotors in reverse order. Finally, the character is shifted back by the rotor positions
Conclusion:
In conclusion, the Enigma machine simulation program is an exact and dependable recreation
of the actual Enigma machine that was used in the past. It does a very good job of simulating
the process of encryption and generates encrypted messages that look random and are
challenging to decode. The constraints of the program are comparable to those of the
historical Enigma machine, which necessitated the use of a different machine in order to
decrypt messages.
The Enigma machine simulation program is, all things considered, an extremely helpful tool
for comprehending the original Enigma machine and the method by which it encrypted
Page 8 of 9
CIS2201 - Cyber Security
References:
2. "Codebreakers: The Inside Story of Bletchley Park" by F.H. Hinsley and Alan Stripp -
This book provides an in-depth look at the work done by codebreakers at Bletchley
Park during World War II, including breaking the Enigma code.
3. "Breaking the Enigma Code" by Dermot Turing - This book provides a detailed look
at the efforts to break the Enigma code, including the role played by Alan Turing and
4. The National Security Agency's (NSA) website - The NSA has a page on their
website dedicated to the Enigma machine and its history, including information on
Page 9 of 9