Cryptography / Sea of Secrets CTF 2026
Welcome
The only input is one string, with the hint "The truth is hidden in the alphabets, not in the words."
Crypto, Medium, 200 pts
Flag: SOS{Welcome_baddy_well_played}
The only input is one string, with the hint "The truth is hidden in the alphabets, not in the words."
text
3HZF7u0WE87LVnejqUQ6yIymxYd4LYh6YqJieV2Oft7iYaggfjl6I93nrGF3N6kEWhTNCdnfjCVuROFAA4sWX7kodThe string uses only 0-9A-Za-z, which fits Base62. Decoding it as a big-endian number in that alphabet gives another string that contains no 0, O, I or l, a sign that it is Base58 (Bitcoin alphabet). Decoding that gives text made only of A-Z2-7, which is Base32. So the layers are Base62, then Base58, then Base32.
Python's base64 module has no Base62 or Base58, so the solver does the base conversion by hand:
python
import base64
BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
def decode_base_n(text, alphabet):
n = 0
for ch in text:
n = n * len(alphabet) + alphabet.index(ch)
lead = len(text) - len(text.lstrip(alphabet[0]))
return bytes(lead) + n.to_bytes((n.bit_length() + 7) // 8, "big")
s = decode_base_n(ciphertext, BASE62).decode()
t = decode_base_n(s, BASE58).decode()
print(base64.b32decode(t).decode())The intermediate values are:
text
Base62: 3mDj8fUq2nVY4SKHQoVgv4c9AMmrStjJi16dPeWfJ58rzQxJf4MRpKsDjtVGdsFm7S
Base58: KNHVG62XMVWGG33NMVPWEYLEMR4V653FNRWF64DMMF4WKZD5
Base32: SOS{Welcome_baddy_well_played}