from binascii import b2a_hex, a2b_hex
a2b_hex hex 转bytes
b2a_hex bytes 转hex
from Crypto.Cipher import AES
mode = AES.MODE_CBC crypto = AES.new(key, mode, iv) plain_text = crypto.decrypt(a2b_hex(text))
from binascii import b2a_hex, a2b_hex
a2b_hex hex 转bytes
b2a_hex bytes 转hex
from Crypto.Cipher import AES
mode = AES.MODE_CBC crypto = AES.new(key, mode, iv) plain_text = crypto.decrypt(a2b_hex(text))