← Back to Writeups
CUSTOMEasyCrypto

Книжный червь (Bookworm)

XESXOR9/2/20262 min read
#crypto#custom#easy#classical-cipher-identificatio#gold-bug-cipher-symbol-substit#character-by-character-decodin

Книжный червь (Bookworm)

Platform: hackerlab | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-01-01 | Status: Solved Techniques: Classical cipher identification from literary hints, Gold-Bug cipher symbol substitution, Character-by-character decoding

Summary

The task mentioned "a cipher by an American writer, used in a story" and required decrypting the text.

Книжный червь (Bookworm) - HackerLab

Description

The task mentioned "a cipher by an American writer, used in a story" and required decrypting the text.

Files:

  • task.txt: 3‡0†8*2?35005*.‡8

Analysis

  1. Cipher identification: The mention of "American writer" and "cipher in a story" points to Edgar Allan Poe's famous story "The Gold-Bug" (1843), which features a substitution cipher with symbols.

  2. Characteristic features: The ciphertext contains distinctive symbols:

    • † (dagger)
    • ‡ (double dagger)
    • * (asterisk)
    • . (period)
    • Digits 0-9 ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍
  3. Gold-Bug substitution table:

A=5, B=2, C=-, D=†, E=8, F=1, G=3, H=4, I=6, J=,, K=7, L=0, M=9
N=*, O=‡, P=., Q=$, R=(, S=), T=;, U=?, V=¶, W=], X=¢, Y=:, Z=[

Solution

Character-by-character decryption:

SymbolLetter
3g
‡o
0l
†d
8e
*n
2b
?u
3g
5a
0l
0l
5a
*n
.p
‡o
8e

Result: REDACTED (Golden Bug + Allan Poe)

Solve Script

python
#!/usr/bin/env python3
"""
Gold-Bug Cipher Decoder
Edgar Allan Poe's "The Gold-Bug" (1843)
"""
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

ciphertext = "3‡0†8*2?35005*.‡8"

# Gold-Bug substitution table
gold_bug_table = {
    '5': 'a', '2': 'b', '-': 'c', '†': 'd', '8': 'e', '1': 'f',
    '3': 'g', '4': 'h', '6': 'i', ',': 'j', '7': 'k', '0': 'l',
    '9': 'm', '*': 'n', '‡': 'o', '.': 'p', '$': 'q', '(': 'r',
    ')': 's', ';': 't', '?': 'u', '¶': 'v', ']': 'w', '¢': 'x',
    ':': 'y', '[': 'z',
}

decoded = ''.join(gold_bug_table.get(c, c) for c in ciphertext)
print(f"Ciphertext: {ciphertext}")
print(f"Decoded: {decoded}")
print(f"Flag: CODEBY{{{decoded}}}")

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

Reference Information

Historical Background

"The Gold-Bug" is one of Poe's most famous stories, which popularized cryptography in popular culture. In the story, the protagonist William Legrand deciphers a pirate treasure map using frequency analysis. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍