Question: Use C++ or Python Assume a plaintext file is stored in ../data/plaintext.txt. A message is in this file is Two One Nine Two And two

Use C++ or Python

Assume a plaintext file is stored in ../data/plaintext.txt. A message is in this file is

Two One Nine Two And two subkeys (in hexadecimal) are given in ../data/subkey example.txt

5468617473206 d79204b756e67204675

e232fcf191129188b159e4e6d679a293

The subkey on the first line is subkey0 and the subkey on the second line is subkey1. Each has 128 bits.

1. First Round of AES Encryption:

  1. (a) Read a message from file ../data/plaintext.txt, change each character into ASCII. After that, you should have 128 bits and obtain an initial state

  2. (b) Read the two subkeys from file ../data/subkey example.txt, calculate one AddKey before Round 1 with subkey0, compute operations in Round 1 (includes SubBytes, ShiftRows, MixColumns and one AddKey with subkey1).

  3. (c) Print your result after the 1st round of AES encryption in terminal and write the result to a file ../data/result.txt. The result needs to be printed and written in hexadecimal.

  4. (d) Take a screenshot for the output of your function in step (c)

  5. Note: for the polynomial additions and multiplications over bytes in GF(28), you can implement them

by yourself or you can find some additional libraries to perform the operations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!