Finding IV in AES-128 having partial Key and plaintext Let's suppose we have the plaintext, 14/16 char of the key and the first 2 and the last 36 chars of encrypted data (that is 64 char long). What I want is to find the IV. The cipher algorithm is AES (I think 128).

As I said, both the Key and the IV are 16 char long, the plaintext is exactly 32 char long and the cyphertext produced is 64.

What tool / process can I use to find the IV knowing all of this stuff? Note that I don't know the full key, but I have a big part of it, so probably some bruteforce is needed.
The way to solve the problem is the following:


Bruteforcing the last 2 elements of the key.
With that key, trying to decrypt the second block of the ciphertext.
XORing that result with the second block of the plaintext.
Comparing the new result with the partial first part of the ciphertext.
If there is a correspondance we have found the right key (also the complete first ciphertext block), else go to step 1.


The last step is applying XOR to the decryption of the first block of the ciphertext and the first plaintext block. This should return the IV that we are looking for.

Since there is no padding (plaintext is 32 char long) this was not too difficult after a better understanding of the algorithm.