1 Input File The input file containing plain text should be named input.trt. The
ID: 669115 • Letter: 1
Question
1 Input File The input file containing plain text should be named input.trt. The plain txt in this file will consist only of uppercase letters (A-Z), punctuation and whitespace characters. Lines will not be longer then 80 characters The number of lines in the file is unkown Sample plain text in an input file: ENCRYPT THIS MESSAGE USING THE ALGORITHM DESCRIBED BELOW The file containing the key should be named key.trt. The key will consist of exactly 16 uppercase letters given in a single line. Example of a key: SIHPLEEXAMPLEKEY 2 Encryption algorithm The encryption algorithm consists of two parts: (1) substitution and (2) encryption on blocks of size 4 x 4 characters. The detailed description of the steps are as follow 1. Preprocessing (5 points) Remove any punetuation and whitespace characters from the input. Input text: ENCRYPT THIS MESSAGE USING THE ALGORITHM DESCRIBED BELOw Output text: ENCRYPTTHISMESSAGEUSINGTHEALGORITHMDESCRIBEDBELOw 2. Substitution (25 points) Perform polyalphabetic substitution using the Vigenere cipher on the input file with the key provided in the key.txt file. Key: SIMPLEEXAMPLEKEY Input text: ENCRYPTTHISMESSAGEUSINGTHEALGORITHMDESCRIBEDBELOV Output text: WVOGJTXQHUHXICHYYMGHTRKDHQPWKYVGLPYSPWGOINTOFOPMIDExplanation / Answer
Method named as padding which turns the cipher text into 4x4 blocks and rest with A's so it is divisible by 16 is can be done as a single set 1bit is added to the message and then as many reset 0bits as required are added. The number of reset 0bit added will depend on the block boundary t which the message needs to be extended. In bit terms this is "1000...0000".
This method can be used to pad messages which are any number of bits long, not necessarily a whole number of bytes long. For example, a message of 23 bits that is padded with 9 bits in order to fill a 32-bit block. This will print the result in bits form depending on AES.
To shift the rows of the output, we can follow method of shifting rows. shift can be done in manner like shifting the fourth row to third position of left side.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.