I have a .mat file which contains 10 plaintexts and 10 ciphertexts which are correctly encrypted with AES-128 algorithm. It also contains 10 more ciphertexts which are wrongly encrypted. The fault is that there is a bitflip in every byte at the input of the last subbyte operation. I also have every single step of AES-128 (encryption/decryption) algorithm in matlab code. My goal is to find the cipherkey.
Here are some tips I got, but still I can't find a way to complete my task:
You can calculate the cipherkey byte per byte cause the last round (subbyte, shiftrows, addroundkey) does modify each byte separately. You can ignore the shiftrows operation cause it does only affect the position. What you have to do is: you guess the key byte, calculate back to the input of the last subbyte operation for both the correct and the faulty ciphertext. Now you can compare them both and check whether the guess of the keybyte was good (think about what characteristics they should have when comparing them). Maybe you have to use multiple pairs of ciphertexts to find one key-byte. After you found the keybyte you can repeat this for all 15 other key-bytes.
I will also attach a screenshot of the result I get loading the .mat file.
Do you have any ideas on what to do with the code in order to find the cipherkey?
Thanks in advance for your help.