[Botan-devel] Using ECB mode gets bad initialization vector size

Jack Lloyd lloyd at randombit.net
Sat Jul 17 08:45:26 EDT 2010


On Sun, Jul 11, 2010 at 02:59:55PM -0400, William K. Foster wrote:
> Hello,
> 
> I have an app up using Botan successfully for cipher specs like AES-128/CTR,
> however, if I try AES-128/ECB, I get an exception thrown that says:
> 
>     Botan: IV length 16 is invalid for AES-128/ECB.

Right, ECB takes no IV at all. (BTW, I take it you are using 1.9.9?
Since this throw is new behavior in that version, before that setting
an IV on a mode that didn't use one would just be silently ignored).

> Apparently, the code is expecting a blockSize of zero, but if I hard wire it
> to zero, it appears my data gets corrupted.

Could you explain / provide source? Using a 0 length IV here (or just
not setting one) should be exactly what you want to do.

-Jack



More information about the botan-devel mailing list