[pycrypto] AES, python 2.7 vs 3
dave.pawson at gmail.com
Mon Feb 3 06:56:24 PST 2014
On 3 February 2014 14:51, Mirko Dziadzka <mirko.dziadzka at gmail.com> wrote:
> 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
Which is what I had (and works fine in 2.7)
iv = Random.new().read(AES.block_size)
seems to work OK in 3.3
XSLT XSL-FO FAQ.
More information about the pycrypto