Подозреваемый (Suspect)
Подозреваемый (Suspect)
Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: Integer to bytes conversion, Big-endian byte order decoding, Hex string to bytes conversion
Summary
Walkthrough of the CUSTOM Crypto Подозреваемый (Suspect). Translation: "The suspect was silent for a long time, then suddenly said a number... We've never encountered this before. Help us understand what he's trying to tell us."
Description
"Подозреваемый долго молчал, а потом внезапно назвал число... Мы никогда с таким не встречались. Помоги понять нам, что он пытается до нас донести."
Translation: "The suspect was silent for a long time, then suddenly said a number... We've never encountered this before. Help us understand what he's trying to tell us."
Analysis
The file sus.txt contains one large number:
6446982264000635652948556502623658209996049063529575549
Key observations:
- Number is too small for RSA — doesn't look like a cryptographic modulus
- Description mentions "number as message" — the suspect "said a number"
- File name "sus" — suspicious
Hypothesis: Text is encoded as a large integer (text-to-int encoding). Each ASCII character is represented as a byte, and the entire byte sequence is interpreted as one large number.
Solution
Method 1: int.to_bytes()
python read-only • copy allowed#!/usr/bin/env python3 n = 6446982264000635652948556502623658209996049063529575549 # Calculate required number of bytes byte_length = (n.bit_length() + 7) // 8 # Convert number to bytes (big-endian) result = n.to_bytes(byte_length, 'big') print(result) # b'CODEBY{REDACTED}'
Method 2: Via hex string
python read-only • copy allowed#!/usr/bin/env python3 n = 6446982264000635652948556502623658209996049063529575549 # Convert to hex, remove '0x' prefix hex_str = hex(n)[2:] # If odd number of characters, add leading zero if len(hex_str) % 2: hex_str = '0' + hex_str # Convert hex to bytes, then to string result = bytes.fromhex(hex_str).decode('utf-8') print(result) # 'CODEBY{REDACTED}'
Verification of reverse conversion
python read-only • copy allowed# How text is encoded into a number: text = "CODEBY{REDACTED}" encoded = int.from_bytes(text.encode(), 'big') print(encoded) # 6446982264000635652948556502623658209996049063529575549
Mathematics
Text-to-int encoding works as follows:
- String
"ABC"= bytes[0x41, 0x42, 0x43] - Big-endian interpretation:
0x41 * 256² + 0x42 * 256 + 0x43 = 4276803
Reverse conversion:
- Number is divided by 256, remainders give bytes from right to left
- Or use
int.to_bytes()in Python
Alternative Names for This Technique
- Text-to-int encoding — encoding text as a number
- Integer message encoding — integer encoding of a message
- Big integer text representation — representing text as a large number
- Bytes-to-int conversion — converting bytes to an integer
Key Takeaways / Lessons
- Mastering Integer to bytes conversion, Big-endian byte order decoding, Hex string to bytes conversion was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2025-12-30 • CUSTOM • Подозреваемый (Suspect) • Difficulty: Easy