Based base
Based base
Platform: taipanbyte | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-02-14 | Status: Solved Techniques: base64_decode, base32_decode, base45_decode, base58_decode, encoding_identification
Summary
Кто-то скажет, что это азы криптографии, основа, фундамент, я же скажу что это база.
Based base — taipanbyte CTF
Description
Кто-то скажет, что это азы криптографии, основа, фундамент, я же скажу что это база.
(Translation: "Some would say these are the basics of cryptography, the foundation, the fundamentals, but I'd say it's the base.")
Four encoded strings provided:
Q1RGe1RoMXNfMXM=
L5KGQM27MZWEAZ27
Y+8M56E2CZ7D*2CS561WE
RN7Q62szvdozbMe
Flag format: CTF{...}
Analysis
- The task name "Based base" and the description heavily hint at Base-N encodings
- Four separate encoded strings suggest the flag is split into parts, each encoded with a different Base scheme
- Identifying each encoding by its character set:
- Line 1
Q1RGe1RoMXNfMXM=— trailing=padding is the classic Base64 giveaway - Line 2
L5KGQM27MZWEAZ27— uppercase letters + digits 2-7 only → Base32 charset - Line 3
Y+8M56E2CZ7D*2CS561WE— the*character is the key clue; standard Base64/Base32/Base85 don't use*, but Base45 does (used in EU COVID QR certificates, charset:0-9 A-Z $%*+-./:) - Line 4
RN7Q62szvdozbMe— mixed case alphanumeric, but notably missing0,O,I,l→ Base58 (Bitcoin/IPFS alphabet)
- Line 1
Solution
Key Insight
The * character in line 3 was the trickiest part to identify. Base45 is less commonly known than Base64/Base32/Base58, but its charset includes * which immediately rules out all other common Base-N encodings. The challenge cleverly escalates from the most common (Base64) to the least common (Base45) encoding.
Decoding Steps
| Line | Encoded | Encoding | Decoded |
|---|---|---|---|
| 1 | Q1RGe1RoMXNfMXM= | Base64 | CTF{Th1s_1s |
| 2 | L5KGQM27MZWEAZ27 | Base32 | _Th3_fl@g_ |
| 3 | Y+8M56E2CZ7D*2CS561WE | Base45 | REDACTED |
| 4 | RN7Q62szvdozbMe | Base58 | b@s1c_B@s3} |
| |
Concatenation: CTF{Th1s_1s + _Th3_fl@g_ + REDACTED + b@s1c_B@s3} = CTF{REDACTED}
Solve Script
python read-only • copy allowed#!/usr/bin/env python3 """ Based base — TaipanByte CTF Multi-Base encoding challenge: Base64 + Base32 + Base45 + Base58 """ import base64 # --- Base45 decoder (RFC 9285) --- BASE45_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:" def base45_decode(s: str) -> bytes: result = [] for i in range(0, len(s), 3): chunk = s[i:i+3] values = [BASE45_CHARSET.index(c) for c in chunk] if len(values) == 3: n = values[0] + values[1] * 45 + values[2] * 45 * 45 result.extend(divmod(n, 256)) else: n = values[0] + values[1] * 45 result.append(n) return bytes(result) # --- Base58 decoder (Bitcoin alphabet) --- BASE58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" def base58_decode(s: str) -> bytes: n = 0 for c in s: n = n * 58 + BASE58_ALPHABET.index(c) result = n.to_bytes((n.bit_length() + 7) // 8, 'big') # Handle leading '1's (zero bytes) pad = len(s) - len(s.lstrip('1')) return b'\x00' * pad + result # --- Decode all parts --- part1 = base64.b64decode("Q1RGe1RoMXNfMXM=").decode() part2 = base64.b32decode("L5KGQM27MZWEAZ27").decode() part3 = base45_decode("Y+8M56E2CZ7D*2CS561WE").decode() part4 = base58_decode("RN7Q62szvdozbMe").decode() flag = part1 + part2 + part3 + part4 print(flag) # CTF{REDACTED}
Output
CTF{REDACTED}
Base Encoding Quick Reference
| Encoding | Charset | Distinctive Features |
|---|---|---|
| Base16 | 0-9 A-F | Hex, always even length |
| Base32 | A-Z 2-7 | Uppercase only, = padding |
| Base45 | 0-9 A-Z $%*+-./: | * character, used in COVID QR |
| Base58 | 1-9 A-Z a-z (no 0OIl) | No confusable chars, Bitcoin/IPFS |
| Base64 | A-Z a-z 0-9 +/ | = padding, most common |
| Base85 | !-u (ASCII 33-117) | Printable ASCII, no whitespace |
| |
Lessons Learned
- The
*character is a dead giveaway for Base45 — no other common Base-N encoding uses it - Base58 deliberately excludes visually ambiguous characters (
0/O,I/l) — check for their absence - When a challenge hints at "base" or "basics", always consider multiple Base-N encodings stacked or concatenated
- Python's
base64stdlib handles both Base64 and Base32; Base45 and Base58 need custom decoders orpip install base45 base58