-
-
Notifications
You must be signed in to change notification settings - Fork 127
Base64 Tool
CarterPerez-dev edited this page Feb 11, 2026
·
1 revision
Multi-format encoding/decoding CLI with recursive layer peeling for security analysis.
A Python CLI tool that handles Base64, Base64URL, Base32, hex, and URL encoding with automatic format detection and recursive multi-layer decoding. The standout feature is layer peeling β the same technique used to analyze obfuscated malware payloads and WAF bypass attempts.
Status: Complete | Difficulty: Beginner
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.14+ | Modern syntax, native type hints |
| Typer | - | CLI framework |
| Rich | - | Terminal formatting |
- Encode/decode across 5 formats (Base64, Base64URL, Base32, Hex, URL)
- Automatic format detection with confidence scoring
- Recursive layer peeling (decodes stacked encodings)
- Chain encoding (apply multiple encodings in sequence)
- Pipe/stdin support
- Analyze obfuscated malware payloads (e.g., DARKGATE multi-layer encoding)
- Decode WAF bypass attempts
- Inspect JWT tokens, certificates, and hex dumps
- Understand why encoding is not encryption
User Command
β
cli.py (Typer commands: encode, decode, detect, peel, chain)
β
ββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ
β encoders.py β detector.py β peeler.py β
β Pure encode β Format β Recursive β
β /decode + β detection + β multi-layer β
β registry β confidence β decoding β
ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ
β
formatter.py (Rich terminal output)
cd PROJECTS/beginner/base64-tool
# Install dependencies
uv sync
# Encode/decode
uv run b64tool encode "Hello World"
uv run b64tool decode "SGVsbG8gV29ybGQ="
# Auto-detect format
uv run b64tool detect "SGVsbG8gV29ybGQ="
# Multi-layer peeling
uv run b64tool chain "alert('xss')" --steps base64,hex
uv run b64tool peel "5957786c636e516f4a33687a63796370"
# Pipe support
echo "SGVsbG8=" | uv run b64tool decodebase64-tool/
βββ src/base64_tool/
β βββ cli.py # Typer commands
β βββ constants.py # Enums, thresholds, character sets
β βββ encoders.py # Pure encode/decode functions + registry
β βββ detector.py # Format detection with confidence scoring
β βββ peeler.py # Recursive multi-layer decoding
β βββ formatter.py # Rich terminal output
β βββ utils.py # Input resolution, text helpers
βββ tests/ # 78 tests across all modules
βββ pyproject.toml
βββ Justfile
# Run tests
uv run pytest tests/ -v
# Linting
uv run ruff check .
# Format
uv run ruff format .Β©AngelaMos | CertGames.com | CarterPerez-dev | 2026