Write a program that runs an exhaustive search attack on a block cipher. As an example, we choose AES cipher in the randomized counter mode with a key space effectively limited to 24 bits. Specifically, the key has the following format (in hex): 80 00 … 00 XX XX XX , where X is an arbitrary hex number. In other words, the first 13 bytes of the key are fixed to be zeroes (except that the first bit is fixed to be “1”), and the last 3 bytes can be arbitrary (so that they need to be checked by exhaustive search).
Your task is to find the key which matches the provided three plaintext-ciphertext pairs. The plaintexts are provided in the files “[login to view URL]”, “[login to view URL]”, and “[login to view URL]”, the respective ciphertexts are in the files “[login to view URL]”, “[login to view URL]”, and “[login to view URL]”, and the respective nonces are in the files “[login to view URL]”, “[login to view URL]”, and “[login to view URL]”. All these files are enclosed in a ZIP archive and posted on the assignment page. Also enclosed in this archive is the Python program which was used to generate the challenge plaintext-ciphertext pairs (“[login to view URL]”), and the function that it uses are placed into a separate file “[login to view URL]”. The code from these files may be re-used for your project. The PyCryptodome package ([login to view URL]) was used to implement cryptographic functions.
Your program must output the key that it found, in the hex format.