1
0
cryptopal/set1/challenge4.py
2023-09-29 23:48:37 +08:00

13 lines
311 B
Python

import binascii
with open("set1/4.txt",'r') as file:
lines = file.readlines()
hex_str = "".join(line.strip() for line in lines)
bytes_str = binascii.unhexlify(hex_str)
for key in range(256):
decrypted = "".join(chr(b ^ key) for b in bytes_str)
print(decrypted)
# 不知道为什么全部都是乱码