Not able to replace pycrypto as a drop in ...
oz123 opened this issue · 1 comments
I think this is related to #15.
I have the following code in my application which works with pycrypto:
chiper = AES.new(dig, mode=AES.MODE_ECB, IV=iv)
The same line raises an Exception with pycryptodome:
TypeError("Unknown parameters for ECB: {'IV': b'%\\x92\\x9ci:u\\xdc\\x83\\x0eNh\\xe9\\x9c\\xb1<Z'}",)
The online API docs have been updated so that iv
(or IV
) does not show up as a parameter applicable to ECB anymore.
It is correct that IV
is silently accepted (and immediately discarded) for ECB mode in PyCrypto, and one may expect that keeps working with PyCrytodome (which is a kind of drop-in replacement). However, as much as I hate breaking APIs, it was an explicit choice not to continue with such dangerous and highly misleading behavior.
I recommend you update your application so that it either does not use the IV
parameter in case of ECB or move to a more secure mode that does employ such extra data.