← Back to Writeups
CUSTOMEasyCrypto

Composite

XESXOR9/10/20263 min read
#crypto#custom#easy#binary_decode#hex_decode#layered_encoding#rot13

Composite

Platform: taipanbyte | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-02-14 | Status: Solved Techniques: binary_decode, hex_decode, layered_encoding, rot13

Summary

Task: Decode a multi-layered encoded binary string. Solution: Apply three decoding layers sequentially: binary (8-bit chunks) to hex string, hex to ASCII revealing a ROT13-shifted flag structure, then ROT13 to recover the plaintext flag.

Composite — TaipanByte CTF

Description

A zip file was provided via a download link (behind anti-bot protection with slide captcha / PoW). The archive txt.zip contained a single file txt.txt with a long binary string.

Analysis

  1. The file txt.txt contains a long string of 0s and 1s — clearly binary encoding
  2. The challenge name "Composite" hints at a composite cipher — multiple encoding layers stacked on top of each other
  3. Decoding proceeds layer by layer until the flag is revealed ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Raw Data

001101000011011100110100011001100011011101100010001101010011000000110100001100100011010101100001001101000011001100110100001100100011010000110110001101010011011000110100001101110011010100110010001101010110011000110101001100000011010100110110001101000011001100110101001101010011010100110010001101000011010100110101011001100011010100110110001101000011011000110101011001100011010000110001001101000011001000110100001101110011010101100110001101010011010100110100011001010011010000110101001101010011000100110011011001100011011101100100

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

Solution

Layer 1: Binary to ASCII

The binary string is composed of 8-bit chunks. Decoding each byte to its ASCII character:

474f7b50425a4342465647525f5056435552455f56465f4142475f554e45513f7d

This is clearly a hexadecimal string (only characters 0-9, a-f).

Layer 2: Hex to ASCII

Decoding the hex string to ASCII:

GO{PBZCBFVGR_PVCURE_VF_ABG_UNEQ?}

This looks like a flag with { and } delimiters, but the text is garbled. The prefix GO instead of TB (TaipanByte flag format) and the recognizable structure suggest ROT13 encoding — each letter is shifted by 13 positions in the alphabet. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Layer 3: ROT13

Applying ROT13 (Caesar cipher with shift 13):

OriginalROT13
G → TO → B
P → CB → O
P → CV → I
V → IF → S
A → NB → O
U → HN → A

Result: TB{REDACTED}

Solve Script

python
#!/usr/bin/env python3
"""
Composite — TaipanByte CTF
Three-layer composite cipher: Binary → Hex → ROT13
"""
import codecs

# Raw binary data from txt.txt
binary_str = (
    "00110100001101110011010001100110001101110110001000110101"
    "00110000001101000011001000110101011000010011010000110011"
    "00110100001100100011010000110110001101010011011000110100"
    "00110111001101010011001000110101011001100011010100110000"
    "00110101001101100011010000110011001101010011010100110101"
    "00110010001101000011010100110101011001100011010100110110"
    "00110100001101100011010101100110001101000011000100110100"
    "00110010001101000011011100110101011001100011010100110101"
    "00110100011001010011010000110101001101010011000100110011"
    "01100110001101110110010000000000000000000000000000000000"
)
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

# Layer 1: Binary → ASCII (hex string)
chars = []
for i in range(0, len(binary_str), 8):
    byte = binary_str[i:i+8]
    if byte == '00000000':
        break
    chars.append(chr(int(byte, 2)))
hex_str = ''.join(chars)
print(f"Layer 1 (Binary → ASCII): {hex_str}")

# Layer 2: Hex → ASCII (ROT13-encoded flag)
rot13_str = bytes.fromhex(hex_str).decode()
print(f"Layer 2 (Hex → ASCII):    {rot13_str}")

# Layer 3: ROT13 → plaintext flag
flag = codecs.decode(rot13_str, 'rot_13')
print(f"Layer 3 (ROT13):          {flag}")

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

Simplified One-Liner

python
#!/usr/bin/env python3
import codecs

data = "001101000011011100110100011001100011011101100010001101010011000000110100001100100011010101100001001101000011001100110100001100100011010000110110001101010011011000110100001101110011010100110010001101010110011000110101001100000011010100110110001101000011001100110101001101010011010100110010001101000011010100110101011001100011010100110110001101000011011000110101011001100011010000110001001101000011001000110100001101110011010101100110001101010011010100110100011001010011010000110101001101010011000100110011011001100011011101100100"
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

# Binary → Hex → ASCII → ROT13
hex_str = ''.join(chr(int(data[i:i+8], 2)) for i in range(0, len(data), 8))
flag = codecs.decode(bytes.fromhex(hex_str).decode(), 'rot_13')
print(flag)
# TB{REDACTED}

Output

TB{REDACTED}

Encoding Layer Detection Cheatsheet

ObservationLikely Encoding
Only 0 and 1, length divisible by 8Binary (8-bit ASCII)
Only 0-9 and a-f/A-FHexadecimal
Recognizable structure but shifted lettersROT13 / Caesar
= or == padding at endBase64
Uppercase + digits 2-7 onlyBase32
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Lessons Learned

  1. The challenge name is always a hint — "Composite" directly tells you the cipher is multi-layered
  2. When decoding layered ciphers, examine each intermediate result carefully to identify the next encoding
  3. ROT13 is easily spotted when the result has a recognizable structure (flag format with { and }) but the letters don't make sense
  4. Anti-bot protections (captcha, PoW) on download links can be bypassed with headless browsers like Playwright ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍