Question using an AES decryption

Alex <[email protected]>
Newsgroups gmane.comp.python.cryptography
Message-ID <LISTSERV%[email protected]>
Greetings, 

first off this is library is awesome stuff! 

I would like to encrypt some text with AES. Following the DES example in 
the Crypto manual I have the following piece of code:

--------------
# Encrypt some text with 256bit AES
from Crypto.Cipher import *
plain="this is some textXXXXXXXXXXXXXXX"  # make text len multiple of 16
obj = AES.new('1234567812345678', AES.MODE_CBC, 'bbbbbbbbaaaaaaaa')
print "Before encryption: ", plain
ciph = obj.encrypt(plain)
print "After decryption: ", ciph
print "After decryption: ", obj.decrypt(ciph)
--------------

Here's the result I'm getting:

--------------
Before encryption:  this is some textXXXXXXXXXXXXXXX
After encryption:  ¸9&#140;&#134;¾{.'PÃWÄ	t&#148;æeäVñ¤Bx&#149;¹QÚ&#150;
After decryption:  &#130;ìnõúµYP&#158;t&#145;øDÞtXXXXXXXXXXXXXXX
--------------

The decryption doesn't work as expected, I'm not receiving my original 
text. I guess I'm passing the wrong parameters to instantiate my AES 
ojbject...

Any ideas?

Thanks in advance for your help.

Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.