I need to implement an AES encryption for firmware distribution system. I have a bootloader that can decrypt various AES variants (ECB,CBC,CTR).
When I approached this I found few issues that aren't clear to me.
First, there's the IV vector, which is strange to me. This vector has to be known to the encryptor and also the decryptor, does it makes sense?
On the decryptor side (source code) I need to input the IV vector, however, on the encryptor side (software encryptor) I can't choose IV vector. (NCrypt, AES Crypter lite, Kryptel). I know that ECB doesn't need one, but how can the software encryptor do CBC or CTR without it, is it randomly generated? If so, how the decryptor will know it?
Another question is regarding the actual size of the encrypted file. It must be divisible by the block size, right? So if my block size is 128, why the output of AES Crypter lite for instance produces a file size which is not divisible by 128?