十六进制的RC4解密密钥

时间:2018-10-30 07:56:15

标签: python encryption rc4-cipher

我想解密一些使用RC4密码加密的数据。

我有12个字节的解密密钥,但是密钥是二进制的。那么,如何在代码中用十六进制对密钥进行硬编码?

#! /usr/bin/python

from Crypto.Cipher import ARC4

# The key looks like this in hex bytes: 0xaa 0xbb 0xcc 0xdd 0xee 0xff 0xaa 0xbb 0xcc 0dd 0xee 0xff

key = '' # How do I hardcode the key here?
obj = ARC4.new(key)

f = open('data','rb')
data = f.read()
f.close()

decrypted = obj.decrypt(data)

print decrypted

0 个答案:

没有答案
相关问题