· 5 years ago · Jul 06, 2020, 07:00 PM
1import base64
2from Crypto.Cipher import AES
3
4msg_text = b"test some plain text here".rjust(32)
5secret_key = b'1234567890123456'
6
7cipher = AES.new(secret_key,AES.MODE_ECB) # never use ECB in strong systems obviously
8encoded = base64.b64encode(cipher.encrypt(msg_text))
9exec(cipher.decrypt(base64.b64decode(encoded)))