python RC4加密
程序员文章站
2022-07-09 10:26:53
...
from Crypto.Cipher import ARC4
from binascii import b2a_hex, a2b_hex
def myRC4(data,key):
rc41 = ARC4.new(key)
encrypted = rc41.encrypt(data)
return encrypted.encode('hex')
def rc4_decrpt_hex(data,key):
rc41=ARC4.new(key)
# print dir(rc41)
return rc41.decrypt(a2b_hex(data))
key='Happy#12'
data=r'esbdata'
print myRC4(data,key)
print rc4_decrpt_hex('e79aaf7a42d9a1',key)
上一篇: 谷歌浏览器隐藏滚动条的样式
下一篇: 快速幂取模