pycrypto’s ciphers should be created as a new instance every time it is called

According to my test, they are stateful objects. Reusing a single instance will lead to wrong results. 

Every time you encrypt or decrypt anything, you should create a new cipher, such as 

cipher = DES3.new(some_key, DES3.MODE_CFB, iv)

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.