Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programing Language C This program will implement an encryption program similar to the German Enigma machine. The Enigma machine will consist of three rotors and
Programing Language C
This program will implement an encryption program similar to the German "Enigma machine. The Enigma machine will consist of three rotors and one reflector. There's no plugboard or any of the other features of a real Enigma machine In the example, the Enigma encryption machine is only capable of encrypting the letters A..F. In the assignment, the program will need to encrypt the entire upper case alphabet A..Z We can pick some permutation of the numbers 1,2,3,4,5,6 like the permutation 4,6,1,2,3,5. We'll use this permutation to replace values. Any time the program encounters 1 it replaces it with 4. Any time it 2 it replaces it with 6. A number never replaces itself so you will never have 3 for example replace with 3. One of these permutations is a "rotor" for reasons which we'll see in a bit. Let's take a look at this diagram of a rotor: 1 4 4 6 If you look at it right-to-left it says the same thing as the permutation; a 1 becomes 4, a 2 becomes 6 and so on. Now picture the lines as wires so that if I put some current on the right wire labelled 1 the current will come out on the wire labelled 4. And I can stack the rotors like this: 4 4 4 6 Now if I put some current on the right 6 for example it goes to 5 across the wire and into the left rotor and out on 3. We can add a third rotor like this: This program will implement an encryption program similar to the German "Enigma machine. The Enigma machine will consist of three rotors and one reflector. There's no plugboard or any of the other features of a real Enigma machine In the example, the Enigma encryption machine is only capable of encrypting the letters A..F. In the assignment, the program will need to encrypt the entire upper case alphabet A..Z We can pick some permutation of the numbers 1,2,3,4,5,6 like the permutation 4,6,1,2,3,5. We'll use this permutation to replace values. Any time the program encounters 1 it replaces it with 4. Any time it 2 it replaces it with 6. A number never replaces itself so you will never have 3 for example replace with 3. One of these permutations is a "rotor" for reasons which we'll see in a bit. Let's take a look at this diagram of a rotor: 1 4 4 6 If you look at it right-to-left it says the same thing as the permutation; a 1 becomes 4, a 2 becomes 6 and so on. Now picture the lines as wires so that if I put some current on the right wire labelled 1 the current will come out on the wire labelled 4. And I can stack the rotors like this: 4 4 4 6 Now if I put some current on the right 6 for example it goes to 5 across the wire and into the left rotor and out on 3. We can add a third rotor like thisStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started