The key to this challenge was to take a look at the specification for the file format.
A WMV file is in most circumstances encapsulated in the Advanced Systems Format (ASF) container format.Looking at the ASF specification, these types of file usually start with a 16 byte GUID that identifies the file type. This hints at a known-plaintext attack. Using some basic linear algebra, given the plaintext and the ciphertext for the first 16 bytes of the file, it is possible to recover the key matrix. Once this key matrix is recovered, the rest of the file can be decrypted and the original wmv file can be recovered. The details of the steps involving the calculations are explained in comments in the code below.
Once the file has been decrypted, the wmv file is playable and it reveals the flag.
No comments:
Post a Comment