Hi,

I've just tried to write a simple example using PyCrypto's
AES (CBC mode)

#!/usr/bin/python
from Crypto.Cipher import AES

PWD='abcdefghijklmnop'
Initial16bytes='0123456789ABCDEF'

crypt = AES.new(PWD, AES.MODE_CBC,Initial16bytes)
# crypt = AES.new(PWD, AES.MODE_ECB)

txt = 'ea523a664dabaa4476d31226a1e3bab0'

c = crypt.encrypt(txt)

txt_plain=crypt.decrypt(c)

print txt_plain

Unfortunately, txt_plain differs from txt - why?
(Using MODE_ECB does work however)

What am I missing?

Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to