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:
-
(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
-
(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).
-
(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.
-
(d) Take a screenshot for the output of your function in step (c)
-
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
Get step-by-step solutions from verified subject matter experts
