The main problem with nonrandom IV is that two identical starting blocks encrypted with the same key will have the same output. So, given your description of the parts from Hamlet, knowing that you use the same IV several times, I would do the following:
- I would calculate the cipher text for "To be or not to be" (16 bytes) for a wide range of probable passwords (how John the Ripper can be created).
- I would compare the resulting cipertext with all the messages, based on the premise that they can begin with these 16 bytes.
- If one matches, I know the password. Done.
I would do the same with a few other well-known phrases. This is an operation that I can do massively in parallel, even before I grab your file and cache in the database. The general term for this approach is the rainbow table .
My work becomes much easier if I know the first 16 bytes of your messages (for example, if they are emails to a famous person or HTTP requests with known headers or the like).
But what if you use random keys (or a suitable KDF, like PBKDF2)? Well, let's say I have several messages from you, and at least some of them have the same first 16 bytes (again, the headers in the protocol help me a lot). Well, the first step is that I know that these messages have the same first 16 bytes. This is very useful information. And now I have a crib to attack your messages.
Reusing an IV + key in CBC does not completely destroy its security (since reusing a Nonce + Key in CTR mode). But this gives the attacker many useful tools to simplify the attack.
I am not saying that any of them will allow you to decrypt your encrypted text in a short period of time. But all of them greatly degrade the alleged strong AES cryptography.
Rob napier
source share