[pycrypto] AES, python 2.7 vs 3

Mirko Dziadzka mirko.dziadzka at gmail.com
Mon Feb 3 06:51:06 PST 2014


Without testing or verifying:

You should probably use bytes in Python 3, not characters.

> v = ''.join(chr(random.randint(0, 0xFF)) for i in range(16))

creates a string of 16 (unicode) characters in Python 3

iv = os.urandom(16)

creates 16 bytes


More information about the pycrypto mailing list