Skip to main content

Professional-grade Python obfuscation and Cython-based compilation suite.

Project description

PyxBlend - Python Obfuscation Suite

Python Version License

pyxblend is a professional-grade Python code protection suite designed for developers who need to secure their intellectual property. It moves beyond simple obfuscation by integrating advanced cryptographic layering and native Cython compilation.

Installation

pip install pyxblend

Quick Start & Examples

Here is how to use each encryption method to protect your Python scripts.

Basic Setup

First, import the library and initialize the encryptor:

from pyxblend import PyxBlend

# Initialize the encryptor
encryptor = PyxBlend()

# The code you want to protect
source_code = """
def secret_function():
    print("This is highly confidential code!")
    print("Logic hidden from prying eyes.")

if __name__ == "__main__":
    secret_function()
"""

Method 1: Compression (m1)

Best for: General purpose obfuscation where file size and speed are important.

# Encrypt using Method 1
encrypted_code = encryptor.encrypt(source_code, method=1)

# Save to a new file
with open("protected_script_m1.py", "w") as f:
    f.write(encrypted_code)

print("Saved protected_script_m1.py")

Method 2: Junk Code & Base85 (m2)

Best for: Confusing static analysis tools and decompilers by injecting junk code.

# Encrypt using Method 2
encrypted_code = encryptor.encrypt(source_code, method=2)

# Save to a new file
with open("protected_script_m2.py", "w") as f:
    f.write(encrypted_code)

print("Saved protected_script_m2.py")

Method 3: Fake Cython Compilation (m3) - SECURE

Best for: Production releases. This compiles your Python code into a C-extension binary. Note: This method generates a loader that compiles the code on the target machine. Ensure gcc is available.

# Encrypt using Method 3
encrypted_code = encryptor.encrypt(source_code, method=3)

if encrypted_code:
    # Save to a new file
    with open("protected_script_m3.py", "w") as f:
        f.write(encrypted_code)
    print("Saved protected_script_m3.py")
else:
    print("Encryption failed! Ensure Cython and GCC are installed.")

Advanced: Random Layering

Best for: Maximum confusion. Apply multiple layers of random obfuscation before the final lock.

# Apply 5 layers of random m1/m2 encryption
layered_code = encryptor.random_encrypt(source_code, iterations=5)

# Then apply the final Cython lock (Method 3)
final_product = encryptor.encrypt(layered_code, method=3)

with open("ultra_secure_script.py", "w") as f:
    f.write(final_product)

Methods Guide

Method Description Security Level
m1 Compression: Variable renaming + Lambda wrapping + LZMA/Base64. Medium
m2 Obfuscation: Junk code injection + Minification + Base85 encoding. Medium-High
m3 Native Compilation: Encrypts source, converts to C via Cython, compiles to binary. Secure

Requirements

  • Python 3.8+
  • cython (for method 3)
  • python_minifier
  • GCC or Clang (for method 3 compilation)

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

pyxblend-2.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

pyxblend-2.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pyxblend-2.0.2.tar.gz.

File metadata

  • Download URL: pyxblend-2.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyxblend-2.0.2.tar.gz
Algorithm Hash digest
SHA256 c3d4fe11b7754368914f3a31a24840d5539bd48cff74dae364a0fad01578d2be
MD5 101a9eed7b2fac70127157c7e31fc877
BLAKE2b-256 fe14b86fa38055566903511982843b53ba2b25c8b7702fcaabf00c42160e2740

See more details on using hashes here.

File details

Details for the file pyxblend-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyxblend-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyxblend-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26e423a8e8d01cdde093a7ef9de564672cd4410776987e6ebfd1fcc946faf566
MD5 6ade9c184e142f94ce99ccd9b1026255
BLAKE2b-256 5adbbecb0161ca5b060c66fa070b08b837c6390b7970a9040b1a87846fabce00

See more details on using hashes here.

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