encryptor provided: def encrypt(data, key): return bytes([octet ^ key for octet in…
- User
encryptor provided:
def encrypt(data, key): return bytes([octet ^ key for octet in data]) key = input('Enter a key (single character): ') if len(key) != 1: raise ValueError("Key must be a single character!") key = ord(key[0]) message = input('Enter a message: ').strip().encode('ascii') encrypted = encrypt(message, key) with open('message.encrypted', 'wb') as fout: fout.write(encrypted) print("Message encrypted and saved to 'message.encrypted'")
message:
2A AA A AA
A A A A AA A AA A A A A A AA AAA WYUTVQ S QUX QRQ YRSXS XWX
clue:
Sending messages between sea captains is like a game of telephone—except the phone is a parrot, and half the message gets lost to rum. Decode the message.
my findings: with character a as key:
ost to rum ctA{6845b7dc0A2A049eA0bd30A83292A969
Requirements:
The output needs to have ctf{...} in it
- Assistant
To decode the encrypted message and retrieve the flag in the format
ctf{...}, follow these steps:Understanding the Encryption
The encryption uses a simple XOR cipher with a single-character key. The process is as follows:
-
Encryption Function:
-