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.3.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.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyxblend-2.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 0d07515ece0599da42fe4b349abba585677606a9bc3e064c4479912302cf5362
MD5 22a94ed25cf26ea35cb92203efc55387
BLAKE2b-256 0ad4357296f9a6684a65b49eb50cd5f93a1068125160bb9686c43d0773b83bfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyxblend-2.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d351e455b4e4666c57e192a25fa25b3440999f21bd8746d081678041f2c6c9f
MD5 33a677cd56dd1eb6021b1b7dea2edbf8
BLAKE2b-256 3e9a61c258c203576588a83388f866f786a84f43f58023bcd7b12eb932242cfc

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