pythonaes加密解密函数Made with Remarkable!
禁止吸烟图片
python的Crypto库中的aes加密函数
忠诚老实
python 的Crypto库中有aes加密的函数,调⽤时指定密钥key和加密模式,然后输⼊明⽂msg就可以加密import binascii
电流的形成from struct import pack, unpack
婴儿鱼肝油
from Crypto.Cipher import AES
key = binascii.hexlify("abcd12340000ffff")
msg = "hello world"
msg += "0" * (16 - len(msg))电子简历
aes = w(key, AES.MODE_ECB)
cypher = pt(msg)
print "key:%s"%key
大腿痛什么原因print "msg:%s"%msg
下载手机铃声>三白茶
print "cypher:%s"%binascii.hexlify(cypher)
运⾏结果:
key:61626364313233343030303066666666
msg:hello world00000
cypher:8a475e2485813c2669740fb11c29a323