你不一致,“a”编码为0x83还是0xA2?“og==”被解码为0xA2,而在评论中你说一对a的编码为0x83 ...
如果你知道密文和明文,你可以尝试使用这个程序:
import struct
import base64
# data to decrypt
todecrypt = base64.b64decode('t5RSTbhuCg==')
# known plaintext and its encrypted equivalent
known_encrypted = base64.b64decode('Pp/nD+RP/WU=')
known_plaintext = b'password'
# determine an encryption key
key = b''.join([struct.pack('B', known_encrypted[i] ^ known_plaintext[i]) for i in range(len(known_encrypted))])
# decrypt data
decrypted = b''.join([struct.pack('B', todecrypt[i] ^ key[i]) for i in range(len(todecrypt))])
print('key', key)
print('decrypted', decrypted)
如果解密的数据不匹配(假设为 test123),这意味着使用了像 RC4 这样的流密码。