Question: Programming Project #3 - C++ - Encryption Read the directions carefully. When you are finished, fill in the boxes at the end of this document.



Programming Project #3 - C++ - Encryption Read the directions carefully. When you are finished, fill in the boxes at the end of this document. Submit a PDF of this document along with a zip of your code, including all files required to build your program and your makefile. Your code will be tested with your makefile. Submit all files required to build your program. Your code will be tested with your makefile. Background One of the simplest forms of encryption is the Caesar cipher which shifts each character in a message by a predetermined amount. The message is decrypted by shifting each character back by the same amount. However, this type of encryption is trivial to break since there are only a finite number of shift values and they can each be checked by brute force even without a computer. Meg: [ T ] [ H ] [ I ] [ S ) [ I ) [ S ][A ] [ T ] [ E ] [ S ] [T ] ASCII: J 8410 7210 7310 8310 7310 8310 6510 8410 6910 8310 841 Key: [ K ] K ][ R ][ R ][ R ] [ R ][ R ][ K ] [ R ] [ K ] [K ] ASCII: [ 7510 7510 75)| 75)| 75)| 751 75)[ 75)| 75)| 7510 751 Result: [159] [147] [148] [158] [148] [158] [140] [159] [144] [158] [159] A more advanced method of encryption is the Vigenere Cipher where instead of a single shift value a keyword is used. Each character in the message is encrypted by shifting the character by an amount determined by a character in the key word. When the key word is exhausted it is recycled and we start at the beginning. Msg: [ T ] [ H ] [ I ] [ S ) [ I ) [ S ] [ A ] [ T ] [ E ] [ S ] [ T ] ASCII: [ 84] [ 72] [ 73] [ 83] [ 73] [ 83] [ 65] [ 84] [ 69] [ 83] [ 84] Key: [ K ] [ E ] [ Y ] [ K ] [ E ] [ Y ] [ K ] [ E ] [ Y ] [ K ] [ E ] ASCII: [ 75] [ 69] [ 89] [ 75] [ 69] [ 89] [ 75] [ 69] [ 89] [ 75] [ 69] Result: [159] [141] [162] [158] [142] [172] [140] [153] [158] [158] [153]Requirements 1. Write a C++ program that manages secret messages. Call the executable encrypt. You Should. create an abstract class called Secret that has a string attribute for a message. a boolean ag indicating if the message has been encrypted, and the following methods: void encrypt {5td: :string key) ,' void decrypt (std: :string key); void display\"; Both encrypt and decrypt should be pure virtual methods. 2. Create 2 derived classes of Secret: Caesar 5c Vigenere that meet the Following requirements. a. Each class should implement the appropriate encryption algorithm. b. The encrypted ag should keep track if the message is encrypted or not. The encrypt function should not do anything if the encrypted flag is set and the decrypt function should not do anything if it is not set. c. The display method should print a string to the console (and only the string - do not include any text that is not the actual message in its current state). If the message is not encrypted, print the original message. If the message is decrypted, print a statement indicating that the message is encrypted along with the type of encryption. 3. Create a C++ program called project3.cpp that uses a single array to hold several secret objects. You should instantiate at least one object of each derived type. For each object. print the original message. then encrypt it and print the encrypted message. Finally. decrypt the message and print the decrypted message. 4. Create a makefile that builds your program. 5. Your program should reflect good design principles. Aim to reduce the amount of unnecessary code throughout your program. Sample Output: BEGIN Message 1 This is a test String encrypted with Caesar This is a test Message 2 This is also a test String encrypted with Vigenere This is also a test Message 3 This is the last test String encrypted with Vigenere This is the last test END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
