Skip to main content

Multi-format encoding/decoding CLI with recursive layer detection for security analysis.

Project description

 ██████╗  ██████╗ ██╗  ██╗████████╗ ██████╗  ██████╗ ██╗
 ██╔══██╗██╔════╝ ██║  ██║╚══██╔══╝██╔═══██╗██╔═══██╗██║
 ██████╔╝███████╗ ███████║   ██║   ██║   ██║██║   ██║██║
 ██╔══██╗██╔═══██╗╚════██║   ██║   ██║   ██║██║   ██║██║
 ██████╔╝╚██████╔╝     ██║   ██║   ╚██████╔╝╚██████╔╝███████╗
 ╚═════╝  ╚═════╝      ╚═╝   ╚═╝    ╚═════╝  ╚═════╝ ╚══════╝
  • Multi format encoding/decoding CLI with recursive layer detection for security analysis.

Features

  • Encode/Decode across Base64, Base64URL, Base32, Hex, and URL encoding formats
  • Auto-detect encoding format with confidence scoring
  • Peel recursively through multi-layered encoding (the kind attackers use to evade WAFs and IDS)
  • Chain multiple encoding steps together for testing obfuscation patterns
  • Pipeline-friendly output for integration into security workflows

Quick Start

uv sync
uv run b64tool encode "Hello World"
uv run b64tool decode "SGVsbG8gV29ybGQ="
uv run b64tool detect "SGVsbG8gV29ybGQ="
uv run b64tool peel "NjQ0ODY1NmM2YzZmMjA1NzZmNzI2YzY0"
uv run b64tool chain "secret" --steps base64,hex,url

Installation

uv sync --all-extras

Usage

Encode

b64tool encode "Hello World"                        # Base64 (default)
b64tool encode "Hello World" --format hex            # Hex
b64tool encode "Hello World" --format base32         # Base32
b64tool encode "hello world&foo=bar" --format url    # URL encoding
echo "piped input" | b64tool encode                  # Stdin
b64tool encode --file secret.txt                     # File input

Decode

b64tool decode "SGVsbG8gV29ybGQ="                   # Base64 (default)
b64tool decode "48656c6c6f" --format hex             # Hex
b64tool decode "JBSWY3DP" --format base32            # Base32

Detect

Identifies the encoding format with confidence scoring:

b64tool detect "SGVsbG8gV29ybGQ="

Peel (Recursive Layer Detection)

The signature feature. Automatically peels back multiple encoding layers, the way real malware and attack payloads obfuscate data:

b64tool peel "NjQ0ODY1NmM2YzZmMjA1NzZmNzI2YzY0"

Chain

Build multi-layered encodings for testing WAF rules, IDS signatures, or understanding obfuscation:

b64tool chain "alert('xss')" --steps base64,hex,url

Security Context

Encoding layering is a real attack technique:

  • WAF Bypass: Double-encoding payloads to slip past web application firewalls (OWASP)
  • Malware Obfuscation: DARKGATE malware uses custom Base64 alphabets with randomized shuffling
  • Data Exfiltration: Base64-encoded data hidden in DNS queries and HTTP headers
  • IDS Evasion: Multi-layer encoding to avoid signature-based detection

This tool helps security professionals analyze and understand these patterns.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

b64tool-0.1.0.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

b64tool-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file b64tool-0.1.0.tar.gz.

File metadata

  • Download URL: b64tool-0.1.0.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for b64tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9915d58cec5a785b66740960ce80dc4c31708911644ffaa7bea1bff5ecfa96a5
MD5 29b98fb1b1f1d9fb7e36076d7bc81609
BLAKE2b-256 730d0237cb2a31b1f04ecee8d88604fe3968d250f9c1c5e8162224679883ae8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for b64tool-0.1.0.tar.gz:

Publisher: publish-base64-tool.yml on CarterPerez-dev/Cybersecurity-Projects

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file b64tool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: b64tool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for b64tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19dc36c79b0691c196edd7a8c6f51b29c09548bd3123edf37f6b8044ad7e905e
MD5 7f8cfcb64bf0cd01574593a329823fa7
BLAKE2b-256 9096a270fe59a845862741eea3438b6f14c0509e68b97f07113f32a4ce9ceb56

See more details on using hashes here.

Provenance

The following attestation bundles were made for b64tool-0.1.0-py3-none-any.whl:

Publisher: publish-base64-tool.yml on CarterPerez-dev/Cybersecurity-Projects

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page