← Back to Writeups
CUSTOMEasyCrypto

Загадочный шифр (Mysterious Cipher)

XESXOR9/2/20263 min read
#crypto#custom#easy#unicode_upside_down_decoding#caesar_bruteforce#string_reversal#leet_speak_recognition

Загадочный шифр (Mysterious Cipher)

Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: unicode_upside_down_decoding, caesar_bruteforce, string_reversal, leet_speak_recognition

Summary

Walkthrough of the CUSTOM Crypto Загадочный шифр (Mysterious Cipher). Task: a zip file with upside-down Unicode text and a hint about flipping. Solution: reverse the string, decode upside-down Unicode characters back to normal, then apply Caesar cipher (shift 20) to rev

Description

Фраза "Я за тебя гору переверну" заиграла новыми красками...

English summary: A zip file is provided containing data.txt with text written using upside-down Unicode characters. The hint phrase "I'll turn the mountain upside down for you" suggests the text needs to be flipped. The goal is to decode the text and find the flag.

Analysis

The file data.txt contains the following content:

ʎʌʞ3ɹʎ‾x3q3ʇ‾x4ʎ3ƃı

These are Unicode characters that represent Latin letters rotated 180°. This is a well-known Unicode trick where special characters visually resemble upside-down versions of normal letters: ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Upside-downNormal
ʎy
ʌv
ʞk
ɹr
‾_ (overline → underscore)
ʇt
ƃg
ıi
qb (b flipped is q)

Numbers (3, 4) and x remain unchanged when flipped.

The task description's hint about "turning upside down" confirms this approach. To read upside-down text correctly, you must:

  1. Reverse the entire string (since upside-down text reads right-to-left)
  2. Convert each flipped character back to its normal form ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Solution

Step 1: Reverse and decode upside-down text

Reading the string in reverse and converting each character:

Original:  ʎ ʌ ʞ 3 ɹ ʎ ‾ x 3 q 3 ʇ ‾ x 4 ʎ 3 ƃ ı
Reversed:  ı ƃ 3 ʎ 4 x ‾ ʇ 3 q 3 x ‾ ʎ ɹ 3 ʞ ʌ ʎ
Decoded:   i g 3 y 4 x _ t 3 b 3 x _ y r 3 k v y

Result: ig3y4x_t3b3x_yr3kvy

Step 2: Caesar cipher brute-force

The decoded text is still not readable English, suggesting an additional encryption layer. Given the task name "Mysterious Cipher" and the leet-speak style, a Caesar cipher is the natural next step. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

python
#!/usr/bin/env python3
"""
Solve script for Mysterious Cipher (Hackerlab)
1. Decode upside-down Unicode text
2. Reverse the string
3. Brute-force Caesar cipher
"""

# Upside-down Unicode character mapping
flip_map = {
    'ʎ': 'y', 'ʌ': 'v', 'ʞ': 'k', 'ɹ': 'r',
    '‾': '_', 'ʇ': 't', 'ƃ': 'g', 'ı': 'i',
    'q': 'b',  # b flipped 180° looks like q
}

# Original upside-down text
encoded = "ʎʌʞ3ɹʎ‾x3q3ʇ‾x4ʎ3ƃı"

# Step 1: Reverse the string
reversed_text = encoded[::-1]

# Step 2: Decode each upside-down character
decoded = ""
for ch in reversed_text:
    if ch in flip_map:
        decoded += flip_map[ch]
    else:
        decoded += ch  # digits and 'x' stay as-is
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

print(f"After flip decode: {decoded}")
# Output: ig3y4x_t3b3x_yr3kvy

# Step 3: Caesar brute-force (letters only, preserve digits and underscores)
def caesar_shift(text, shift):
    result = ""
    for ch in text:
        if ch.isalpha():
            base = ord('a') if ch.islower() else ord('A')
            result += chr((ord(ch) - base + shift) % 26 + base)
        else:
            result += ch
    return result

print("\nCaesar brute-force:")
for shift in range(26):
    shifted = caesar_shift(decoded, shift)
    print(f"  Shift {shift:2d}: {shifted}")
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

# Shift 20 gives: REDACTED
# Which reads as: caesar_never_sleeps (leet-speak)
print(f"\nFlag: CODEBY{{{caesar_shift(decoded, 20)}}}")

Step 3: Identify the correct shift

Testing all 26 shifts, shift 20 produces:

REDACTED

This reads as "caesar_never_sleeps" in leet-speak (3→e, 4→a), confirming it's the correct decryption. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Key Takeaways / Lessons

  • Mastering unicode_upside_down_decoding, caesar_bruteforce, string_reversal, leet_speak_recognition was key to this challenge.
  • Always check for common misconfigurations and verify assumptions.

Crafted by XESXOR Research • 2026-04-04 • CUSTOM • Загадочный шифр (Mysterious Cipher) • Difficulty: Easy