ScriptCTF 2025 Writeups Series – Enchant

Category: Misc

scriptCTF is a 48-hour jeopardy style CTF for hackers to test their skills against creative and innovative CTF challenges. We have mostly beginner friendly challenges, with a few hard ones. scriptCTF makes CTFs fun and approachable for all skill levels! This is hosted by ScriptSorcerers and some members of n00bzUnit3d (as a replacement of n00bzCTF).

If open the enc.txt file in browser, will find:

ᒲ╎リᒷᓵ∷ᔑ⎓ℸ ̣ ╎ᓭ⎓⚍リ

According to the information given to us in the challenge, this is clearly text from Minecraft’s Enchantment Table language (Standard Galactic Alphabet, SGA); the “weird” characters in enc.txt are actually SGA glyphs rendered as a result of mojibaking (incorrect character encoding).

Solution Hypothesis

  1. The text in enc.txt is mojibaked due to an encoding mixup between Windows-1252/CP1252 and UTF-8.
  2. Retrieve the SGA glyphs with the CP1252 → UTF-8 conversion.
  3. Translate using the SGA glyph → Latin letter (A–Z) mapping.

Although I initially tried to decode the incorrect character encoding, when I saved the page and examined the downloaded file, it returned text in the SGA language. All that remained was to decode it. But I have already written the code that decodes the text that appears with incorrect character encoding on the browser.

# save as decode_sga.py and run: python3 decode_sga.py enc.txt
import sys

fn = sys.argv[1] if len(sys.argv) > 1 else "enc.txt"
raw = open(fn, "rb").read()  # ham bytes

try:
    s = raw.decode("cp1252")
except Exception:
    s = raw.decode("utf-8", errors="replace")

sga_map = {
    "ᔑ":"A","ʖ":"B","ᓵ":"C","↸":"D","ᒷ":"E","⎓":"F","⊣":"G","⍑":"H",
    "╎":"I","⋮":"J","ꖌ":"K","ꖎ":"L","ᒲ":"M","リ":"N","!¡":"O","ᑑ":"P",
    "∷":"Q","ᓭ":"R","ℸ\u0323":"S",
    "⚍":"T","⍊":"U","∴":"V","̇/":"W","ǁ":"X","||":"X","⨅":"Z",
}

s = s.replace("\u2138 \u0323", "\u2138\u0323")

items = sorted(sga_map.items(), key=lambda x: -len(x[0]))
translated = s
for g,letter in items:
    translated = translated.replace(g, letter)

print("---- RAW (after cp1252->utf8 attempt) ----")
print(s)
print("---- TRANSLATED (SGA -> A..Z) ----")
print(translated)

FLAG: scriptCTF{MINECRAFTISFUN}