
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
pyprotectorx
Advanced tools
Universal Python Code Protection
# Desktop / PC / Mac
pip install pyprotectorx
# Termux (Android)
pkg install python
pip install pyprotectorx
# Pydroid3 (Android)
# Menu β Pip β Search: pyprotectorx β Install
# Protect any Python file
pyprotectorx script.py
# Run protected file
python script.protected.py
from pyprotectorx import protect
# Protect file
protect("script.py")
# Output: script.protected.py
from pyprotectorx import encrypt, run
# Encrypt code
source = 'print("Hello, World!")'
encrypted = encrypt(source)
# Run encrypted code
run(encrypted)
# Create test script
echo 'print("Secret Code!")' > test.py
# Protect it
pyprotectorx test.py
# Run protected version
python test.protected.py
# Output: Secret Code!
# Install
pkg install python -y
pip install pyprotectorx
# Protect your script
cd ~/storage/shared
pyprotectorx myapp.py
# Share the protected file
python myapp.protected.py
from pyprotectorx import protect
# Protect file
protect("/sdcard/Download/script.py")
# Output: /sdcard/Download/script.protected.py
protect(input_file, output_file=None)Easiest method - Protect a Python file
from pyprotectorx import protect
protect("app.py") # β app.protected.py
protect("app.py", "secure.py") # β secure.py
encrypt(source_code)Encrypt Python source code
from pyprotectorx import encrypt
encrypted = encrypt('print("Hi")')
# Returns: bytes
run(encrypted_data)Execute encrypted code
from pyprotectorx import run
namespace = run(encrypted_data)
# Returns: dict with execution namespace
info()Show version information
from pyprotectorx import info
print(info())
# {'version': '5.5.0', 'python': '3.12.0', ...}
| Layer | Technology |
|---|---|
| 1 | ChaCha20 stream cipher |
| 2 | PBKDF2 (150,000 iterations) |
| 3 | HMAC-SHA256 authentication |
| 4 | Blake2b cryptographic hashing |
| 5 | SHA3-256 additional hashing |
| 6 | CRC32 integrity checking |
| 7 | Zlib compression layer |
| 8 | Custom obfuscation layers |
| 9 | Bundle sealing |
Python Source Code
β
[1] Syntax validation
β
[2] Compile to bytecode
β
[3] Marshal serialization
β
[4] Custom compression + encryption
β
[5] ChaCha20 encryption
β
[6] HMAC authentication
β
[7] Bundle sealing with metadata
β
[8] Base64 encoding
β
Protected Python File
# Storage access
termux-setup-storage
# Work in shared storage
cd ~/storage/shared
# Protect scripts
pyprotectorx script.py
# Use full paths
from pyprotectorx import protect
# Protect file in Downloads
protect("/sdcard/Download/app.py")
# Protect file in Documents
protect("/sdcard/Documents/script.py")
β
Linux, macOS, Windows
β
Termux (Android)
β
Pydroid3 (Android)
β
Raspberry Pi
β
Cloud environments
# Check Python version
python --version
# Termux: Install Python 3.11+
pkg install python
# Pydroid3: Update app to latest version
# Reinstall package
pip uninstall pyprotectorx -y
pip install --no-cache-dir pyprotectorx
# Validate your script first
python -m py_compile script.py
# Use direct encryption API
from pyprotectorx import encrypt
import base64
encrypted = encrypt(source_code)
# Store encrypted bytes separately
with open('data.bin', 'wb') as f:
f.write(encrypted)
β οΈ Important: No encryption is unbreakable. PyProtectorX makes reverse engineering significantly harder but cannot guarantee absolute protection against determined attackers with unlimited resources.
Good for:
Not a substitute for:
MIT License - Copyright (c) 2025 Zain Alkhalil
See LICENSE file for details.
Zain Alkhalil
If you find PyProtectorX useful:
Thanks to all contributors and users who helped improve PyProtectorX!
Made with β€οΈ for the Python community
Protect your code. Protect your work. Protect your future.
FAQs
PPX ENCRYPTION - Python 3.11/3.12/3.13 - Termux & Pydroid3
We found that pyprotectorx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.