Skip to main content

A robust tool for Python code obfuscation and encryption using Cython.

Project description

pyshielder - Python Code Shield

Python Version License

pyshielder is a powerful tool to protect your Python code. It combines advanced multi-layer bytecode obfuscation with native compilation to create highly secure executable scripts.

Features

  • Advanced Layering: Compiles code to bytecode, serializes with Marshal, compresses with Zlib, encodes with Base64, and obfuscates the structure.
  • Strong Encryption: Wraps the obfuscated payload in a secure loader encrypted with rolling-key XOR.
  • Native Compilation: The final loader is compiled into a native C binary using Cython and GCC, executing directly in memory.
  • Tamper Resistant: No original source code or simple bytecode is visible. Reverse engineering requires reconstructing multiple layers of obscured logic.
  • Self-contained: The output is a single Python script that self-compiles and executes.

Installation

pip install pyshielder

Note: You need gcc (or clang) and python3-dev installed on your system to use the encryption tool and to run the generated protected scripts.

Usage

Command Line Interface

You can use pyshielder directly from the command line:

# Encrypt a file
pyshielder my_script.py

# Specify output directory
pyshielder my_script.py protected_script.py

Python API

from pyshielder import encrypt

# Encrypt a script string
code = "print('Hello, protected world!')"
loader_code = encrypt(code)

# Save the loader to a file
with open("protected_script.py", "w") as f:
    f.write(loader_code)

License

MIT License - see LICENSE 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

pyshielder-1.0.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

pyshielder-1.0.4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file pyshielder-1.0.4.tar.gz.

File metadata

  • Download URL: pyshielder-1.0.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyshielder-1.0.4.tar.gz
Algorithm Hash digest
SHA256 96a3e8f617f79f3cd95d10b55eb8f2485d8dc1e3ebbf1b29a734bffadb7944bc
MD5 735e83c60c4a694fe40ff4716cfb0c8a
BLAKE2b-256 545f35f9b5a4f7710be31986b9effd5c261d2d60a6991169f34e9e9b61f0d1c5

See more details on using hashes here.

File details

Details for the file pyshielder-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyshielder-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyshielder-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7f85548ed7bb316b7cfe0fb7cd9a9c79a6f3e2794b7dd6084184cd5d565d1209
MD5 dd49b321e883e55ad4139963dcbbd358
BLAKE2b-256 52ed0a7971e7af30fcfc418ae808c934cae71c355af12be5e6167a2913af5983

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