You are required to write a program that can read from


Assignment - The Enigma Machine

Background

The Enigma machine (https://en.wikipedia.org/wiki/Enigma_machine) was an electro-mechanical cipher engine that was used extensively by the German military in World War 2.

The Allies were eventually able to crack the codes generated by Enigma - a feat that gave the Allies a significant advantage in the latter half of the war.

The efforts to crack the Enigma machine started in Poland, but were most famously run at Bletchley Park (https://en.wikipedia.org/wiki/Bletchley_Park).

Alan Turing (https://en.wikipedia.org/wiki/Alan_Turing) was part of the team to break Enigma.

These efforts also resulted in the construction of the world's first electro-mechanical computer - the Bomba (https://en.wikipedia.org/wiki/Bomba_(cryptography)).

There were some weaknesses in the design of the Enigma machine, foremost among them being that a letter could never be encrypted to itself. For example, if the operator pressed the A key, it was impossible for this to light up the A lamp. This weakness allowed Allied cryptographers to limit their search space.

Due to the design of the Enigma machine, encoding and decoding a message used the same process. If the Enigma machine was initialized to the same settings as the machine than encoded a message, typing the coded message into it would result in the original text. You can use this "round trip" quality to test your code as you build your solution.

Requirements

You are required to write a program that can read from standard input and encode or decode a message using a simplified version of the Enigma machine.

1. Your program must first accept between one and three space delimited codewheel identifiers. Valid identifiers are I, II, III, IV, V.

2. Your program must then accept the corresponding number of rotor starting positions. Valid starting positions are A-Z.

3. Your program must then accept the message to be encoded. Spaces are to be replaced with the letter X.

4. Your program must encode the message, and print it to standard output.

Attachment:- Assignment.rar

Request for Solution File

Ask an Expert for Answer!!
Other Engineering: You are required to write a program that can read from
Reference No:- TGS01656325

Expected delivery within 24 Hours