pyobfus
Modern Python Code Obfuscator
A Python code obfuscator built with AST-based transformations. Supports Python 3.8 through 3.14 (including the latest stable release). Provides reliable name mangling, string encoding, and code protection features.
Features
🆓 Community Edition (Free)
- Name Obfuscation: Rename variables, functions, and classes to I0, I1, I2...
- Comment Removal: Strip comments and docstrings
- String Encoding: Base64 encoding for string literals
- Multi-file Support: Obfuscate entire projects
- YAML Configuration: Flexible configuration system
- Parameter Preservation: Keep function parameter names for keyword arguments
💎 Professional Edition - $45 USD
- ✨ All Community Features +
- 🔀 Control Flow Flattening: Transform code structure into state machines
- 🧩 Dead Code Injection: Inject unreachable code to increase complexity
- 🔐 AES-256 String Encryption: Military-grade encryption for strings
- 🛡️ Anti-Debugging Checks: Detect and prevent debugging attempts
- 📅 License Embedding: Expiration dates, machine binding, run limits
- ⚡ Configuration Presets: One-command setup (trial, commercial, library)
- 🔄 Lifetime Updates: All future Pro features included
- 💻 Up to 3 Devices: Use on multiple machines
- 📧 Priority Email Support
Installation
From PyPI (recommended):
pip install pyobfus
From source (for development):
git clone https://github.com/zhurong2020/pyobfus.git
cd pyobfus
pip install -e .
Quick Start
Obfuscate a single file:
pyobfus input.py -o output.py
Obfuscate a directory:
pyobfus src/ -o obfuscated/
With configuration:
pyobfus src/ -o obfuscated/ --config pyobfus.yaml
Example
Before obfuscation:
def calculate_total(price, quantity):
"""Calculate total price."""
tax_rate = 0.1
subtotal = price * quantity
tax = subtotal * tax_rate
return subtotal + tax
After obfuscation:
def I0(I1, I2):
I3 = 0.1
I4 = I1 * I2
I5 = I4 * I3
return I4 + I5
Note: Variable names may vary slightly, but functionality is preserved.
Documentation
- README - Full documentation
- Roadmap - Future features
- Changelog - Version history
- Security Policy - Report vulnerabilities
Community & Support
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and ideas
- Contributing - How to contribute
Purchase Professional Edition
💎 Professional Edition - $45 USD
One-time payment • Lifetime access
What's Included:
- ✅ Control Flow Flattening - State machine transformation
- ✅ Dead Code Injection - Increase code complexity
- ✅ AES-256 String Encryption
- ✅ Anti-Debugging Checks
- ✅ License Embedding - Expiration, machine binding, run limits
- ✅ Configuration Presets - One-command setup
- ✅ Lifetime Updates
- ✅ Up to 3 Devices
- ✅ Email Support (zhurong0525@gmail.com)
⚡ Instant delivery • 🔒 Secure checkout • 💯 30-day money-back guarantee
Try Before You Buy
Want to test Pro features before purchasing? Use the 5-day free trial:
# Start a free trial (no credit card required)
pyobfus-trial start --email your@email.com
# Quick start with presets
pyobfus src/ -o dist/ --preset commercial
# Or use individual features
pyobfus input.py -o output.py --control-flow --string-encryption --anti-debug --dead-code
# With license restrictions
pyobfus src/ -o dist/ --expire 2025-12-31 --bind-machine
# Check trial status
pyobfus-trial status
The trial includes all Pro features with full functionality for 5 days.
How to Purchase
Step 1: Click “Buy Now” and complete secure checkout (Stripe)
Step 2: Receive your license key via email within minutes
Step 3: Activate your license
pip install --upgrade pyobfus
pyobfus-license register PYOB-XXXX-XXXX-XXXX-XXXX
Activation Guide
Full activation instructions: License Activation Guide
Legal & Policies
By purchasing pyobfus Professional Edition, you agree to our:
- Terms of Service & EULA
- Refund Policy - 30-day money-back guarantee
- Privacy Policy - GDPR compliant
Security Note
String Encryption Limitations: AES-256 string encryption is designed as a deterrent against casual reverse engineering, not as cryptographic security. Because obfuscated code must decrypt strings at runtime, the encryption key is embedded in the output. This is a fundamental limitation of all client-side obfuscators.
Recommendation: For sensitive credentials (API keys, passwords), use environment variables or external secret management systems rather than embedding them in code.
See our full README for detailed security guidance.
License
Dual License Model:
- pyobfus (Core): Apache 2.0 - Free and open source
- pyobfus_pro (Pro): Proprietary - Requires paid license
Built with Python 3.8-3.14 • AST-based Transformations • Open Source