[ pycrypto-Bugs-1473773 ] Every mode except ECB in AES fails?

"SourceForge.net" <[email protected]> Thu, 20 Apr 2006 11:59:12 -0700
Newsgroups gmane.comp.python.cryptography.cvs
Message-ID <[email protected]>
Bugs item #1473773, was opened at 2006-04-20 18:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=120937&aid=1473773&group_id=20937

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Juan de las Calzas Verdes (calzas)
Assigned to: Nobody/Anonymous (nobody)
Summary: Every mode except ECB in AES fails?

Initial Comment:
See a little script and its results

--------------------------
import Crypto.Cipher.AES
import binascii

AES = Crypto.Cipher.AES
text = 'abcdefghijklmnop'
myIV = '0123456789ABCDEF'
mykey = '16 bytes text XX'
print 'Original: ', binascii.hexlify(text)
for mode in range(1, 6):
    obj = AES.new(mykey, mode, myIV)
    dec = obj.decrypt(obj.encrypt(text))
    print 'Mode: ', mode, '  Decr(Encr(Original)): ',
binascii.hexlify(dec)
--------------------------

Output:

Original:  6162636465666768696a6b6c6d6e6f70
Mode:  1   Decr(Encr(Original)): 
6162636465666768696a6b6c6d6e6f70
Mode:  2   Decr(Encr(Original)): 
fe8c779f1bf840fc83de99bf8ddca587
Mode:  3   Decr(Encr(Original)): 
776978676b3c2d69180143ed54cfd062
Mode:  4   Decr(Encr(Original)): 
9ef7106d9d229f2d696a6b6c6d6e6f70
Mode:  5   Decr(Encr(Original)): 
c2e0fd3ee88477829300f6a77565cbc0


Why doesn't it work? Shouldn't it? It does work if you
create different objects for encryption and decryption.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=120937&aid=1473773&group_id=20937


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642