Authority over your cryptography.
🔑 Features • 📦 Installation • 🚀 Usage • 🛡️ Security • 📸 Screenshots • 🤝 Contributing
Bahll is a terminal defensive cryptography toolkit designed for developers who need reliable, secure crypto operations without the complexity of custom implementations. Built with PHP, it provides an interactive CLI menu for hashing, encryption, key management, auditing, and more — all while enforcing secure-by-default practices.
Whether you're a developer integrating crypto into your app, a security engineer auditing secrets, or just experimenting with cryptography, Bahll gives you authority over your crypto workflows.
Bahll v1.0 transforms from interactive-only to a full-featured dual-mode tool:
-
Interactive Mode - Traditional menu-driven interface
php bahll.php # Full interactive menu -
Direct CLI Commands - Execute operations without menu navigation
# Flag-style (modern & recommended) bahll --hash --algo=sha256 --data="test" bahll --encrypt --algo=aes-256-gcm --data=/path/to/file # Positional (still supported) php bahll.php hash sha256 "test" php bahll.php encrypt aes-256-gcm "data" "key"
-
System Command Setup - Install
bahllas a direct terminal command (nophpprefix)# Make it available globally php setup.php # or chmod +x /path/to/Bahll/bahll.php # Now run anywhere: bahll --help bahll --hash --algo=sha256 --data="hello"
Key Benefits:
- ✅ Scripting-friendly - Use in shell scripts, CI/CD pipelines, cron jobs
- ✅ No syntax memorization - Long-flag format is self-documenting
- ✅ File workflows - Auto-confirmation & optional passphrase for file operations
- ✅ Batch operations - Encrypt/decrypt directories with single command
- ✅ System integration - Works like any native CLI tool
Bahll offers a comprehensive suite of cryptographic tools, organized into intuitive categories:
- SHA-1 (
⚠️ with deprecation warning) - SHA-256, SHA-512 🛡️
- SHA3 (when available)
- BLAKE2 / BLAKE3 (availability checked)
- HMAC 🔐 for message authentication
- PBKDF2 🏗️ for password-based key derivation
- bcrypt and scrypt 🔒 for secure password hashing
- Argon2id 🏆 for modern KDF
- AES-256-GCM (default, AEAD mode) 🛡️
- AES-CBC (with HMAC, warned as insecure without AEAD)
⚠️ - ChaCha20-Poly1305 (when libsodium available) 🔐
- Password-based encryption with automatic IV/salt handling 🔑
- File and string encryption/decryption 📁
- RSA keypair generation (2048+ bits enforced) 🔑
- Ed25519 for fast, secure signing 📝
- ECDSA support
- X25519 for key exchange 🔄
- Sign and verify files/messages ✅
- Key strength validation 🛡️
- Encrypted local keyring with passphrase protection 🔒
- Import/export keys securely 📤📥
- Key rotation and expiration ⏰
- List keys with metadata 📋
- Enforce strong passphrase policies 🛡️
- 🔒 Encrypt entire folder structures with password protection
- 📂 Recursive directory support with metadata preservation
- 🔑 Secure key derivation (SHA-256)
- 📊 Real-time encryption statistics and progress
- 🗂️ Automatic folder structure creation
- 📁 Decryption with output to separate directory
- 📝 Complete audit trail of all cryptographic operations
- 🛡️ Non-sensitive logging - passwords/keys never recorded
- 🔐 Base64-encoded storage for additional obfuscation
- 🔍 Smart sanitization - removes hex strings, base64 blobs, tokens
- 📊 Real-time statistics: entry count, file size, timestamps
- 📤 Export logs for compliance and auditing purposes
- Base64 (standard and URL-safe) 🔤
- Base32 and Base58 🔢
- Hex encoding/decoding 🔟
- ASCII armor for PEM-like formats 📄
- CSPRNG token generation 🎰
- Secure password generator 🔑
- Entropy warnings
⚠️ for weak sources
- Detect weak keys and insecure ciphers 🔍
- Warn on deprecated algorithms
⚠️ - Human-readable security reports 📊
- Score your crypto configurations 🏆
- Scan files for secrets 🔎
- Mask and rotate secrets 🔄
- Revoke keys and enforce expiration ⏰
- Pre-commit hooks for security scans 🪝
- Generate secure passwords, tokens, salts instantly
- Pre-commit security scanning 🪝
- Artifact signing and verification ✍️
- Release integrity checks ✅
- Machine-readable CI output 🤖
- Extensible architecture for custom crypto components 🧩
- Safe module loading 🛡️
- Folder-based plugin discovery 📁
Bahll follows a modular, CLI-first architecture:
- No web dependencies: Pure terminal tool.
- Plugin system: Safe loading of custom components.
- Encrypted storage: Keyring uses libsodium AEAD for security.
- Fail-closed design: Errors halt execution with clear messages.
- PSR-4 autoloading: Standard PHP structure.
Built for developers, by developers — secure, simple, and extensible.
User Input → CLI Menu → Core Module → Secure Operation → Output
↓ ↓ ↓ ↓ ↓
Prompt Navigation Hash/Sym/Asym Validation Result
| Layer | Description | Tech |
|---|---|---|
| Input | Sanitized prompts | PHP CLI |
| Crypto | Audited primitives | OpenSSL/Sodium |
| Storage | Encrypted keyring | AEAD (XChaCha20) |
| Audit | Real-time checks | Built-in validators |
| Output | Clear error messages | Fail-closed |
-
Clone the repository:
git clone https://github.com/BangAguse/Bahll.git cd Bahll -
Run the setup script:
php setup.php
This checks extensions, creates necessary directories, and generates
composer.json. -
Install dependencies (if using Composer):
composer install
That's it! Bahll has no external PHP dependencies — it uses only built-in extensions.
Start the interactive CLI:
php bahll.phpYou'll see the ASCII banner, then a main menu with categories. Navigate using numbers, enter data as prompted, and results are displayed inline.
- Select "1) Hashing & KDF"
- Choose "2) SHA-256"
- Enter your string
- Get the hash output
- Select "2) Symmetric Encryption"
- Choose "1) AES-256-GCM encrypt string"
- Provide plaintext and optional password
- Receive a base64-encoded blob for decryption
- Select "3) Asymmetric Crypto"
- Choose "1) Generate RSA keypair"
- Specify key size (2048+)
- Get PEM-formatted keys
Bahll now supports direct command-line execution for easy scripting and automation:
# Hash operations
php bahll.php hash sha256 "Hello World"
php bahll.php hash bcrypt "password123"
php bahll.php hash argon2 "secure-password" 65536
# Encryption/Decryption
php bahll.php encrypt aes-256-gcm "secret-data" "encryption-key"
php bahll.php decrypt aes-256-gcm "[encrypted-blob]" "encryption-key"
# Key generation
php bahll.php asymmetric generate rsa-4096
php bahll.php asymmetric generate ed25519
# Random data
php bahll.php random bytes 32
php bahll.php random token 32
php bahll.php random password 16
php bahll.php random string 20
# Encoding
php bahll.php encoding base64 "data"
php bahll.php encoding hex "data"
php bahll.php encoding url "data"
# Auditing
php bahll.php audit check
php bahll.php audit hash-file /path/to/file sha256
# Activity logs
php bahll.php logs view
php bahll.php logs export
# Help & Version
php bahll.php --help
php bahll.php --versionBahll now supports modern flag-based commands for scripting:
# Hashing
bahll --hash --algo=sha256 --data="Hello World"
# Encryption (file-based)
bahll --encrypt --algo=aes-256-gcm --data=/path/to/file.txt --key=password
# Output: /path/to/file.txt.bahll
# Decryption (file-based)
bahll --decrypt --algo=aes-256-gcm --data=/path/to/file.txt.bahll --key=password
# Output: /path/to/file.txt.dec
# Random data
bahll --random --type=bytes --length=32
# Directory bruteforce
bahll --bruteforce --path=/path/to/encrypted_folder
# Help
bahll --helpMake bahll executable from anywhere:
# System-wide (requires sudo)
chmod +x /path/to/Bahll/bahll.php
sudo ln -sf /path/to/Bahll/bahll.php /usr/local/bin/bahll
# Or per-user (no sudo)
mkdir -p "$HOME/bin"
cat > "$HOME/bin/bahll" <<'EOF'
#!/bin/sh
php /path/to/Bahll/bahll.php "$@"
EOF
chmod +x "$HOME/bin/bahll"Full CLI Documentation: See CLI_DOCUMENTATION.md for complete command reference and CLI_QUICK_REFERENCE.md for quick lookup.
Shell Scripts:
#!/bin/bash
# Generate secure API key
API_KEY=$(php bahll.php random token 32)
# Hash it for storage
API_HASH=$(php bahll.php hash sha256 "$API_KEY")
echo "Generated key: $API_KEY"
echo "Stored hash: $API_HASH"PHP Integration:
<?php
// Generate random password in PHP
$password = shell_exec('php /path/to/bahll.php random password 16');
// Hash configuration with AES-256
$config = file_get_contents('config.php');
$encrypted = shell_exec("php /path/to/bahll.php encrypt aes-256-gcm " . escapeshellarg($config) . " " . escapeshellarg($masterKey));
?>CI/CD Pipeline (GitHub Actions):
- name: Generate signing key
run: php bahll.php random token 32 > signing-key.txt
- name: Hash dependencies
run: |
php bahll.php audit hash-file composer.lock sha256 > deps.hash
php bahll.php audit hash-file package.json sha256 >> deps.hashFor automation, Bahll can be scripted or integrated into CI pipelines via its CLI output.
Encryption & decryption using flags (recommended for scripting):
# Encrypt a file (prompts confirmation and optional passphrase)
php bahll.php --encrypt --algo=aes-256-gcm --data=/home/user/secret.txt --key="optional-key"
# Decrypt a file (prompts confirmation and optional passphrase)
php bahll.php --decrypt --algo=aes-256-gcm --data=/home/user/secret.txt.bahll --key="optional-key"
# Hash data using flag
php bahll.php --hash --algo=sha256 --data="Hello World"
# Bruteforce a directory (ethical confirmation required)
php bahll.php --bruteforce --path=/home/user/encrypted_folderThese flag-style commands are fully scriptable and suitable for CI. Positional usage (php bahll.php encrypt aes-256 "data" "key") remains supported for backwards compatibility.
Bahll is built with a fail-closed, defensive mindset:
- Rejects weak configurations (e.g., RSA < 2048 bits) with clear error messages like "✖ Rejected by Bahll: Weak cryptographic configuration detected"
- Uses constant-time comparisons for sensitive operations
- Prefers AEAD modes (GCM, Poly1305) over vulnerable CBC
- Warns on deprecated algorithms (SHA-1)
- No custom crypto — only audited, standard primitives
Always verify outputs and use in production with caution. Bahll is designed for secure development workflows.
We welcome contributions! Here's how to get started:
- Fork the repo at github.com/BangAguse/Bahll
- Clone locally:
git clone https://github.com/BangAguse/Bahll.git - Run
php setup.phpandcomposer install - Make changes, add tests in
tests/ - Run
php bahll.phpto test interactively - Submit a PR with a clear description
For bugs or features, open an issue at github.com/BangAguse/Bahll/issues. Follow PHP PSR-12 coding standards.
Repository: github.com/BangAguse/Bahll
Author: @BangAguse
If you find Bahll useful, consider supporting its development via donation.
Your support helps keep the project maintained and improved.
MIT License — see LICENSE for details.
Built with ❤️ for secure development workflows. Replace the demo GIF with a repository asset for offline viewing.


