Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will implement an encryption system in C++ using a modified, simplified version of AES (Advanced Encryption System) on our CSE machines that will (1)

You will implement an encryption system in C++ using a modified, simplified version of AES (Advanced Encryption System) on our CSE machines that will (1) read the plain text from a file and a key from another file; (2) encrypt the plain text according to the requirements detailed below; and (3) write the output for each step to the screen and to an output file. Your source code must be sufficiently commented to explain your program. At a minimum, you should comment the header (e.g., name, class date, brief description of the program), all variables (i.e., what each variable is used for), and specific blocks of code. This applies to all user-defined functions as well. For example, use comments to describe the inputs, the formulas used, and any other important steps in your code. Be sure to handle any applicable error conditions in your code (e.g., if there is a problem opening the file, etc.).

1. Input Files Your program will prompt the user to enter the name of the input file containing the plain text that will be encrypted (i.e., the plaintext input file) as well as the name of the input file containing the key that will be used in the encryption process (i.e., the key input file). The input file containing the plain text will consist solely of uppercase letters (e.g., A Z), punctuation, and whitespace characters. Lines will not be longer than 80 characters, but the number of lines in the file is not known. Example plain text in an input file: ENCRYPT THIS MESSAGE USING THE ALGORITHM DESCRIBED BELOW. The file containing the key will contain the key consisting of exactly 16 uppercase letters given in a single line. Example of a key in a key file: SIMPLEEXAMPLEKEY

2. Output File Your program will prompt the user to enter the name of the output file containing the output of each step of the encryption algorithm. Your program will write the output of each step of the encryption algorithm in the output file. First, write the name of the step on a separate line, and then write the output of that particular step. If the output in a particular step is manipulate as blocks of 4 4, then it should appear as blocks of 4 4 in the output file. Make sure that immediately after each step, you write the data in the output file and save the file. If you do not do this and your program crashes, then there will be no output produced, so partial credit will be limited.

3. Encryption Algorithm The encryption algorithm shall consist of two parts: (1) substitution, and (2) encryption on blocks of size 4 4 characters. The detailed description of the steps is as follows: Preprocessing Remove any punctuation and whitespace characters from the input. o Example: Input Text: ENCRYPT THIS MESSAGE USING THE ALGORITHM DESCRIBED BELOW. Output Text: ENCRYPTTHISMESSAGEUSINGTHEALGORITHMDESCRIBEDBELOW Substitution Perform a polyalphabetic substitution using the Vigenre cipher on the input file with the key provided in the key input file. o Example: Key: SIMPLEEXAMPLEKEY Input Text: ENCRYPTTHISMESSAGEUSINGTHEALGORITHMDESCRIBEDBELOW Output Text: WVOGJTXQHUHXICWYYMGHTRKQHQPWKYVGLPYSPWGOINTOFOPMO Padding Steps d f are performed on blocks of size 4 x 4 characters formed from the output of step b (i.e., substitution). They are parts of AES and as in any block cipher, the input has to be padded. In this particular case, pad the output from the previous step with As so that the length of the message is divisible by 16. o Example: Input: Output: WVOG WVOG JTXQ JTXQ HUHX HUHX ICWY ICWY YMGH YMGH TRKQ TRKQ HQPW HQPW KYVG KYVG LPYS LPYS PWGO PWGO INTO INTO FOPM FOPM O OAAA AAAA AAAA AAAA

ShiftRows This step is the same as the ShiftRows step in the AES encryption. Circularly shift the rows in each block in the following fashion: The first row remains the same. Shift the second row one position to the left. Shift the third row two positions to the left. Finally, shift the fourth row three positions to the left.

Parity Bit Convert each character to its numeric value (0 127) and use the most significant bit as a parity bit

MixColumns This step diffuses the data and is the same as the MixColumns step in the AES encryption. The transformation is performed by multiplying the circulant MDS matrix with each column from the input (i.e., the output of step e) as shown below. However, instead of simple multiplication, it uses multiplication in the Rijndaels Galois field. But this is not as difficult as it sounds since this transformation matrix only contains the numbers 1, 2, and 3. Therefore, you will only multiply with 1, 2, and 3.

also include a makefile for the files!

PLEASE PLEASE PLEASE HELP! It is due Thursday 15th at midnight

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago