πŸš€ DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

pyprotectorx

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyprotectorx

PPX ENCRYPTION - Python 3.11/3.12/3.13 - Termux & Pydroid3

pipPyPI
Version
5.5.0
Maintainers
1

πŸ” PyProtectorX v5.5.0

Universal Python Code Protection

Python PyPI License Mobile

✨ Features

  • πŸ”’ Military-grade encryption (ChaCha20 + PBKDF2 150k iterations)
  • 🐍 Python 3.11, 3.12, 3.13 support
  • πŸ“± Mobile optimized - Termux & Pydroid3
  • πŸš€ Simple API - 3 functions
  • πŸ’ͺ Zero dependencies - Pure Python
  • ⚑ Fast - Optimized for all platforms

πŸ“¦ Installation

# Desktop / PC / Mac
pip install pyprotectorx

# Termux (Android)
pkg install python
pip install pyprotectorx

# Pydroid3 (Android)
# Menu β†’ Pip β†’ Search: pyprotectorx β†’ Install

🎯 Quick Start

Command Line (Easiest)

# Protect any Python file
pyprotectorx script.py

# Run protected file
python script.protected.py

Python API

from pyprotectorx import protect

# Protect file
protect("script.py")
# Output: script.protected.py

Advanced API

from pyprotectorx import encrypt, run

# Encrypt code
source = 'print("Hello, World!")'
encrypted = encrypt(source)

# Run encrypted code
run(encrypted)

πŸ“– Complete Examples

Example 1: Basic Usage

# Create test script
echo 'print("Secret Code!")' > test.py

# Protect it
pyprotectorx test.py

# Run protected version
python test.protected.py
# Output: Secret Code!

Example 2: Termux

# 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

Example 3: Pydroid3

from pyprotectorx import protect

# Protect file
protect("/sdcard/Download/script.py")

# Output: /sdcard/Download/script.protected.py

πŸ”₯ API Reference

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', ...}

πŸ›‘οΈ Security Features

LayerTechnology
1ChaCha20 stream cipher
2PBKDF2 (150,000 iterations)
3HMAC-SHA256 authentication
4Blake2b cryptographic hashing
5SHA3-256 additional hashing
6CRC32 integrity checking
7Zlib compression layer
8Custom obfuscation layers
9Bundle sealing

βš™οΈ How It Works

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

πŸ“± Mobile Development Tips

Termux Best Practices

# Storage access
termux-setup-storage

# Work in shared storage
cd ~/storage/shared

# Protect scripts
pyprotectorx script.py

Pydroid3 Tips

# 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")

⚠️ Requirements & Limitations

Requirements

  • Python 3.11, 3.12, or 3.13
  • No additional dependencies

Limitations

  • Maximum file size: 100 MB
  • Source code must have valid syntax
  • Python 3.14+ not yet supported

Compatibility

βœ… Linux, macOS, Windows
βœ… Termux (Android)
βœ… Pydroid3 (Android)
βœ… Raspberry Pi
βœ… Cloud environments

πŸ› Troubleshooting

Error: "Python 3.11+ required"

# Check Python version
python --version

# Termux: Install Python 3.11+
pkg install python

# Pydroid3: Update app to latest version

Error: "Failed to load core"

# Reinstall package
pip uninstall pyprotectorx -y
pip install --no-cache-dir pyprotectorx

Error: "Syntax error in source"

# Validate your script first
python -m py_compile script.py

Protected file too large

# 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)

πŸ”’ Security Notice

⚠️ Important: No encryption is unbreakable. PyProtectorX makes reverse engineering significantly harder but cannot guarantee absolute protection against determined attackers with unlimited resources.

Good for:

  • βœ… Protecting proprietary algorithms
  • βœ… Preventing casual code inspection
  • βœ… Obfuscating business logic
  • βœ… License key protection
  • βœ… Anti-tampering measures

Not a substitute for:

  • ❌ Proper authentication systems
  • ❌ Secure password storage
  • ❌ Network security
  • ❌ Server-side validation

πŸ“Š Version History

v5.5.0 (Latest)

  • ✨ Added Python 3.13 support
  • πŸš€ Improved mobile performance
  • πŸ› Bug fixes and optimizations
  • πŸ“± Enhanced Termux compatibility

v5.1.0

  • ✨ Python 3.11 & 3.12 support
  • πŸ“± Termux & Pydroid3 optimization
  • πŸ”’ Enhanced encryption layers

πŸ“„ License

MIT License - Copyright (c) 2025 Zain Alkhalil

See LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Zain Alkhalil

  • Specialized in Python security & cryptography
  • Mobile development enthusiast
  • Open source contributor

🌟 Support the Project

If you find PyProtectorX useful:

  • ⭐ Star on GitHub
  • πŸ› Report bugs
  • πŸ’‘ Suggest features
  • πŸ“’ Share with others
  • β˜• Buy me a coffee

πŸ™ Acknowledgments

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.

Keywords

encryption obfuscation security protection code-protection termux pydroid3 android mobile

FAQs

Did you know?

Socket

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.

Install

Related posts