from import pad, unpad
from import AES
BLOCK_SIZE = 32 # Bytes
key = 'abcdefghijklmnop'
cipher = (('utf8'), AES.MODE_ECB)
msg = (pad(b'hello', BLOCK_SIZE))
print(())
decipher = (('utf8'), AES.MODE_ECB)
msg_dec = (msg)
print(unpad(msg_dec, BLOCK_SIZE))
需要用block_size 补充位数
此处是模拟php openssl_encrypt($data, "AES-128-ECB", $key, OPENSSL_RAW_DATA)