← Back to Writeups
CUSTOMEasyCrypto

Easy encryptor — Cyclic XOR

XESXOR9/2/20261 min read
#crypto#custom#easy#cyclic_xor_decryption

Easy encryptor — Cyclic XOR

Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: cyclic_xor_decryption

Summary

Walkthrough of the CUSTOM Crypto Easy encryptor — Cyclic XOR. Task: XOR encryption script with visible key and encoded file. Solution: Apply the same XOR operation with the same key to decrypt (XOR is symmetric).

Description

"c4n y0u r3v3r53 m3?" with Python encoder script and encoded file.

Analysis

Given an encryption script with the key "strong_key". XOR is a symmetric operation: encrypt(encrypt(x)) = x. Simply apply the same XOR with the same key.

Solution

python
#!/usr/bin/env python3
# Original encoder (from the task):
# def encode(data, key):
#     return bytes(d ^ key[i % len(key)] for i, d in enumerate(data))
# 
# key = b"strong_key"
# encoded = encode(plaintext, key)
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

def decode(data, key):
    # XOR is symmetric - same operation for decryption
    return bytes(d ^ key[i % len(key)] for i, d in enumerate(data))

key = b"strong_key"

# Read the encrypted file
with open("encoded.bin", "rb") as f:
    encoded = f.read()

plaintext = decode(encoded, key)
print(plaintext.decode())
# Output: spbctf{REDACTED}

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Key Takeaways / Lessons

  • Mastering cyclic_xor_decryption was key to this challenge.
  • Always check for common misconfigurations and verify assumptions.

Crafted by XESXOR Research • 2026-03-08 • CUSTOM • Easy encryptor — Cyclic XOR • Difficulty: Easy