Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objectives The objectives for this lab assignment is as follows: To implement a program based on Caesar Cipher. To crack an encrypted message by brute
Objectives The objectives for this lab assignment is as follows: To implement a program based on Caesar Cipher. To crack an encrypted message by brute force. Programming Tools Recommended languages are C, C++, Java, Python, Matlab, etc. . Try to use only one programming language to finish this lab assignment. GUI implementation is not required in this lab. Requirements Please read the requirements carefully, and finish the lab assignment accordingly. Implement a program based on Caesar Cipher: Write a program that can implement the Caesar cipher. It takes as input plain ascii text, a character "D" or "E" to denote decryption or encryption and a key k that is also a capital alphabet. It converts the text into all caps, ignores all other characters and outputs the ciphertext or plaintext as the case may be. Make sure that it prints an error if anything other than DoE is typed or if the key is not a capital alphabet. Steps: 1. This implementation targets on letters only, no space or any other characters would be involved. 2. All letters, including the key k, are all converted to capital letters. 3. All letters would be transformed into numbers so that algebraic computations could be applied, please refer to the ASCII code. 4. The keyk is a random capital letter of your own choice, which could be entered at the Terminal Prompt. 3. The input plain ascii text is a string of your own choice, which could be entered at the Terminal Prompt. 6. Input character "D" or "E" denotes the mode decryption or encryption, it could also be entered at the Terminal Prompt. 7. An example result at the Terminal could be like this: Type 'E' or 'D' to choose encryption mode or decryption mode: Type the key('A'-'Z') you want to choose :D Type the string you want to input:atallguyjustwalkin Output text is DWDOOJXBMXVWZDONLQ Program ended with exit code: 6 [Type here) & Show some example inputs and outputs. 9. Attach the source code with your lab report. Brute Force Attack: The following piece of ciphertext is discovered. GOGOXDDYCOOKWYFSOVKCDGOOU If it is the substitution cipher, determine the value of the key k by brute force. Steps: 1. You can use the program from your first program. You may need to modify your program a little bit 2. Show all the results for each value of the key k for k = 1,2,..., 25. 3. After you determine the value of the key k, show that decrypted text in your report. 4. For example, if k = 13 is correct, then the decrypted text would be a sentence like "WEHADSOMUCHFUNLASTWEEK
Step 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