In some cases - with one block of plaintext, an additional block of padding is required, in order to avoid ambiguities during decryption stemming from padding. In these cases, an IV is required, because you now have chaining, due to the fact that there are multiple blocks.
For example, suppose you have one block of ciphertext, and upon decrypting this block, the result is:
b8 13 32 76 39 6d 6c 0e 71 58 ba 80 43 3e fa 01
Notice the last byte, 01
. Is this 15 bytes of plaintext, followed by one byte of PKCS#7 padding? Or, is this 16 bytes of plaintext (where the last byte happens to be 01
), without any padding?
If the decryptor is following PKCS#7, then the decryptor will think the last byte is padding, and remove this byte from the output.
If the original plaintext is in fact 16 bytes (with the last byte being 01
), then this block should be padded with another block of 00 padding bytes, as per PKCS#7, during encryption. This way, there is no ambiguity as to what is padding and what is plaintext during decryption.
In this case, being that the input to the encryptor is now multiple blocks, an IV is necessary.