Question
Write a program that asks the user to enter a string into an array to encrypt your data using a key. Program, will compile and
Write a program that asks the user to enter a string into an array to encrypt your data using a key. Program, will compile and run on Windows 7 or 10 using Visual Studio 2019 in C++ using the standard Visual Studio libraries and run in a 32-bit environment. It shall be a command/console based program.
Your program must be able to input all white space characters (etc,, tab, space, etc). You are to use a class named Crypto with private data memberschar InputDataBuffer[133]; // you process 16 characters at a timechar CryptoKey[9]; // Using a user inputted 8-bit keychar CryptoMatrix[133];char ClearMatrix[133];short InputDataCount;
You will need to keep track of the input char data count.You will have member functions named InputData, Encrypt, Decrypt, DisplayCryptoMatrix, and DisplayClearMatrix. There will be no return arguments nor any passed arguments since this we are using a class. Only 1 cpp file is to be used along with a single .h file. No global variable are to be used but global constants are allowed. Remember that since a class that is just declared does not have any memory assigned to it yet, class data members can not have values assigned to them until an instance of the class is done. I know that vs2019 will allow this but earlier version do not. So you cant. for constants in a class use static const somename=something.
Encrypt operator is as follows. You will take the first char in the InputDataBuffer and XOR it with the first char in the CryptoKeyBuffer and store the result in the CryptoMatrix first char As in InpChar0 XOR KeyChar0 -> CryptoMatrixChar0. Then repeat the process as shown in Example 1 below. Repeating until all input data has been processed. To avoid any issues of input data being less than 8 characters, you will prefill the InputDataBuffer with spaces (i.e., 20h)
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