← Back to Writeups
CUSTOMEasySteganography

TextTextText

XESXOR9/2/20262 min read
#steganography#custom#easy#line_length_steganography#windows

TextTextText

Platform: taipanbyte | Category: Steganography | Type: Challenge | Difficulty: Easy | OS: Windows | Author: XESXOR | Date: 2026-01-22 | Status: Solved Techniques: line_length_steganography

Summary

Given a text file main.f with an article about WorldSkills.

TextTextText — taipanbyte

Description

Нашёл какой-то интересный текст о WorldSkills. Как думаешь, здесь есть что-то скрытое?

Given a text file main.f with an article about WorldSkills.

Analysis

The text looks normal, but upon closer inspection, words are split across lines in strange places — breaks are not by words or syllables.

Key observation: each line's length corresponds to an ASCII character code.

Decoding line lengths:

Line 0:  102 chars = 'f'
Line 1:  108 chars = 'l'
Line 2:   97 chars = 'a'
Line 3:  103 chars = 'g'
Line 4:    0 chars = (separator)
Line 5:   83 chars = 'S'
Line 6:  116 chars = 't'
Line 7:   51 chars = '3'
Line 8:  103 chars = 'g'
Line 9:   75 chars = 'K'
Line 10:  97 chars = 'a'
Line 11:  95 chars = '_'
Line 12: 112 chars = 'p'
Line 13:  82 chars = 'R'
Line 14:  49 chars = '1'
Line 15: 107 chars = 'k'
Line 16: 111 chars = 'o'
Line 17: 108 chars = 'l'

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

The flag "REDACTED" is a wordplay: "Стёжка Прикол" (steganography + joke in Russian).

Solution

python
#!/usr/bin/env python3
"""
Line-length steganography decoder.
Each line has a length equal to the ASCII code of a flag character.
"""

with open('main.f', 'rb') as f:
    data = f.read()

# Split by CRLF (Windows line endings)
lines = data.split(b'\r\n')

flag = ''
for line in lines:
    length = len(line)
    if 32 <= length <= 126:  # Printable ASCII
        flag += chr(length)

print('Flag:', flag)  # flagREDACTED -> flag{REDACTED}

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

Technique Variations

  • Line-length encoding: line length = ASCII code (as here)
  • Word-count encoding: number of words per line = character
  • First-letter encoding: first letters of lines/words form a message (acrostic)
  • Whitespace steganography: spaces/tabs at end of lines encode bits ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍