← Back to Writeups
CUSTOMEasyCrypto

Семья (Family)

XESXOR9/10/20263 min read
#crypto#custom#easy#multi-encoding-recognition#number-system-conversion-(hex#binary#octal#decimal#unicode)#pattern-recognition-to-identif#powers-of-2-relationship-ident

Семья (Family)

Platform: hackerlab | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2025-12-30 | Status: Solved Techniques: Multi-encoding recognition, Number system conversion (hex, binary, octal, decimal, unicode), Pattern recognition to identify encoding boundaries, Powers of 2 relationship identification

Summary

Task: Decode a file containing mixed number system encodings (hex, binary, octal, decimal, unicode). Solution: Identify encoding boundaries by pattern recognition and convert each segment to ASCII.

Семья (Family) — HackerLab

Description

"У каждого брата свой язык, но их что-то связывает" (Each brother has his own language, but something connects them)

Analysis

The file family.txt contains data in mixed format:

43 4F 44 45 01000010 01011001 01111011 144 61 146 146 63 162 63 156 164 137 110 117 109 98 51 114 95 U+73 U+79 U+73 U+74 U+33 U+6D U+73 U+7D

The key hint in the description: "brothers with different languages, but connected" — this refers to different number systems that are positional and related as powers of two. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Encoding Identification

  1. Hexadecimal (base 16): 43 4F 44 45 — 2-digit hex values
  2. Binary (base 2): 01000010 01011001 01111011 — 8-bit binary strings
  3. Octal (base 8): 144 61 146 146 63 162 63 156 164 137 — only digits 0-7
  4. Decimal (base 10): 110 117 109 98 51 114 95 — contains 8 and 9, cannot be octal
  5. Unicode (hex code points): U+73 U+79 U+73 U+74 U+33 U+6D U+73 U+7D — U+XX format

Recognition Patterns

EncodingIndicators
Hex2 characters, digits 0-9 and letters A-F
Binary8 characters, only 0 and 1
Octal3 characters, only digits 0-7
DecimalNumbers contain 8 or 9
UnicodeU+ prefix
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Solution

python
#!/usr/bin/env python3
"""
Семья (Family) - HackerLab Crypto
Multi-encoding challenge: hex, binary, octal, decimal, unicode
"""

content = '43 4F 44 45 01000010 01011001 01111011 144 61 146 146 63 162 63 156 164 137 110 117 109 98 51 114 95 U+73 U+79 U+73 U+74 U+33 U+6D U+73 U+7D'
parts = content.split()

# Hex (indices 0-3): 43 4F 44 45
hex_decoded = ''.join([chr(int(h, 16)) for h in parts[0:4]])
print(f"Hex: {parts[0:4]} -> {hex_decoded}")

# Binary (indices 4-6): 01000010 01011001 01111011
bin_decoded = ''.join([chr(int(b, 2)) for b in parts[4:7]])
print(f"Binary: {parts[4:7]} -> {bin_decoded}")
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

# Octal (indices 7-16): 144 61 146 146 63 162 63 156 164 137
octal_decoded = ''.join([chr(int(p, 8)) for p in parts[7:17]])
print(f"Octal: {parts[7:17]} -> {octal_decoded}")

# Decimal (indices 17-23): 110 117 109 98 51 114 95
dec_decoded = ''.join([chr(int(p)) for p in parts[17:24]])
print(f"Decimal: {parts[17:24]} -> {dec_decoded}")

# Unicode (indices 24-31): U+73 U+79 U+73 U+74 U+33 U+6D U+73 U+7D
uni_decoded = ''.join([chr(int(u.replace('U+', ''), 16)) for u in parts[24:32]])
print(f"Unicode: {parts[24:32]} -> {uni_decoded}")
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

flag = hex_decoded + bin_decoded + octal_decoded + dec_decoded + uni_decoded
print(f"\nFlag: {flag}")

Output

Hex: ['43', '4F', '44', '45'] -> CODE
Binary: ['01000010', '01011001', '01111011'] -> BY{
Octal: ['144', '61', '146', '146', '63', '162', '63', '156', '164', '137'] -> d1ff3r3nt_
Decimal: ['110', '117', '109', '98', '51', '114', '95'] -> numb3r_
Unicode: ['U+73', 'U+79', 'U+73', 'U+74', 'U+33', 'U+6D', 'U+73', 'U+7D'] -> syst3ms}

Flag: CODEBY{REDACTED}

Number System Relationship

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

The "brothers" are number systems related as powers of two:

  • Binary (2^1)
  • Octal (2^3)
  • Hexadecimal (2^4)
  • Decimal and Unicode — additional "relatives" in the encoding family ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍