← Back to HWJ CTF

XOR_IS_COOL

Decrypt repeating-key XOR encoded file using key 'encrypt'.

Tools Used

PythonCyberChefXOR

Overview

Message file is encrypted with repeating-key XOR using key string encrypt.

Reconnaissance

Apply inverse XOR using key encrypt across message bytes.

Exploitation Strategy

XOR ciphertext bytes sequentially with key index: data[i] ^ key[i % len(key)].

Solution Code

key = b"encrypt"
data = open("message.bin", "rb").read()
print(bytes(d ^ key[i % len(key)] for i, d in enumerate(data)).decode())

Flag

hwj{this_is_next_level_encryption}