DES3-CBC gotcha encrypt/decrypt on same object
Bug #673120 reported by
ine ya
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python-Crypto |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I just spent quite a while trying to use the same object to encrypt something and decrypt the result. As I later figured out, this doesn't work and although this is not a bug, I would kindly ask to mention this in documentation, possibly to include example similar to one below.
=======
#!/usr/bin/python
from Crypto.Cipher import DES3
obj=DES3.
plain="Guido van Rossum is a space alien."
ciph=obj.
print repr(ciph)
obj2=DES3.
print obj.decrypt(ciph) # doesn't work -> avoid!
print obj2.decrypt(ciph) # works
=======
To post a comment you must log in.
Good idea.
Done: https:/ /github. com/dlitz/ pycrypto/ commit/ b9658a26003ebfc fce1804a2363a29 354799b47e