Implementing AES Implement (almost) the first round of AES with a 128-bit key. Given a 128-bit plaintext and a 128-bit key, this involves: Performing a bitwise XOR with the plaintext and the key Applying byte substitution for each byte in the state Applying shift rows on the state table rows Applying mix columns on the state table columns Output the state table at this point. The "almost" above means that you don't have to perform the XOR with the state and the first sub-key. Please name the program AESEncryptRound.java or aesencryptround.py. You may hard code the inputs. Please use the following inputs, which are the same as given in Appendix B of the FIPS197 document: plaintext = 0x3243f6a8885a308d313198a2e0370734 key = 0x2b7e151628aed2a6abf7158809cf4f3c The byte substitution, multiply-by-2, an multiply-by-3 tables are available at AEStables.txt. Each is given as a list where the ith entry is the value of applying the given operation to i. Please print the state table after each step. Using the inputs given in Appendix B, my program outputs: Original plaintext 32 88 31 e0 43 5a 31 37 f6 30 98 07 a8 8d a2 34 After ARK with original key 19 a0 9a e9 3d f4 c6 f8 e3 e2 8d 48 be 2b 2a 08 After SB d4 e0 b8 1e 27 bf b4 41 11 98 5d 52 ae f1 e5 30 After SR d4 e0 b8 1e bf b4 41 27 5d 52 11 98 30 ae f1 e5 After MC 04 e0 48 28 66 cb f8 06 81 19 d3 26 e5 9a 7a 4c
Implementing AES Implement (almost) the first round of AES with a 128-bit key. Given a 128-bit plaintext and a 128-bit key, this involves: Performing a bitwise XOR with the plaintext and the key Applying byte substitution for each byte in the state Applying shift rows on the state table rows Applying mix columns on the state table columns Output the state table at this point. The "almost" above means that you don't have to perform the XOR with the state and the first sub-key. Please name the program AESEncryptRound.java or aesencryptround.py. You may hard code the inputs. Please use the following inputs, which are the same as given in Appendix B of the FIPS197 document: plaintext = 0x3243f6a8885a308d313198a2e0370734 key = 0x2b7e151628aed2a6abf7158809cf4f3c The byte substitution, multiply-by-2, an multiply-by-3 tables are available at AEStables.txt. Each is given as a list where the ith entry is the value of applying the given operation to i. Please print the state table after each step. Using the inputs given in Appendix B, my program outputs: Original plaintext 32 88 31 e0 43 5a 31 37 f6 30 98 07 a8 8d a2 34 After ARK with original key 19 a0 9a e9 3d f4 c6 f8 e3 e2 8d 48 be 2b 2a 08 After SB d4 e0 b8 1e 27 bf b4 41 11 98 5d 52 ae f1 e5 30 After SR d4 e0 b8 1e bf b4 41 27 5d 52 11 98 30 ae f1 e5 After MC 04 e0 48 28 66 cb f8 06 81 19 d3 26 e5 9a 7a 4c
Trending now
This is a popular solution!
Step by step
Solved in 2 steps