CBC des3 encryption raise exception on IV length
Brought to you by:
twhiteman
define a triple_des with padmode=PKCS5 and mode=CBC
when you try to encrypt a data that is longer then 8 bytes you'll get an exception about the length of the IV
If you look through the code you'll see you assign a block (of 16 bytes) into the IV which cause the exception
Here is the exception text:
File "C:\Python25\lib\site-packages\pyDes.py", line 716, in encrypt
self.__key1.setIV(block)
File "C:\Python25\lib\site-packages\pyDes.py", line 314, in setIV
raise ValueError("Invalid Initial Value (IV), must be a multiple of " + str(
self.block_size) + " bytes")
ValueError: Invalid Initial Value (IV), must be a multiple of 8 bytes