This piece of code worked and then started with an error
ValueError: AES key must be 16, 24 or 32 bytes long
This is in Python 3.3.5.
from Crypto.Cipher import AES
salt = '!%F=-?Pst970'
key32 = [ ' ' if i >= len(self.salt) else self.salt[i] for i in range(32) ]
bkey32 = str(key32).encode('utf-8')
cipher = AES.new(bkey32, AES.MODE_ECB)
The AES constructor fails with the ValueError specified in the header.
bkey32:
b"['!', '%', 'F', '=', '-', '?', '\\x7f', 'P', 's', 't', '9', '7', '0', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']"
I believe this is 32 bytes. What am I doing wrong?