mirror of
https://github.com/20kaushik02/CSE548_ACNS_Work.git
synced 2025-12-06 07:54:07 +00:00
13 lines
428 B
Python
13 lines
428 B
Python
import sys
|
|
|
|
with open("3/forstudents/a/ciphertext.bin", "rb") as cipher_file, open(
|
|
"3/forstudents/a/key.bin", "rb"
|
|
) as key_file:
|
|
cipher_content = cipher_file.read()
|
|
key_content = key_file.read()
|
|
print(
|
|
((
|
|
int.from_bytes(cipher_content, sys.byteorder) ^ int.from_bytes(key_content, sys.byteorder)
|
|
).to_bytes(max(len(cipher_content), len(key_content)), sys.byteorder)).decode()
|
|
)
|