Skip to main content

pyEncripto — a tool for encrypting Python projects and securely running them with encrypted modules and assets

Project description

🔐 PyEncripto

PyEncripto is a tool for encrypting Python source code and resources (assets) with secure runtime decryption. It is designed to protect intellectual property and create encrypted Python packages.

🚀 Features

  • 🔒 Encrypt .py files into .crpt using AES (CFB mode)
  • 📦 Package and encrypt resources (from assets/ folder) into assets.pak
  • 🧹 Runtime loading of encrypted modules
  • 🖼 Runtime loading and decryption of encrypted assets (images, sounds, etc.)
  • 🔑 Support for encryption keys
  • 🧪 Run encrypted projects with preserved main.main() interface

📦 Installation

pip install pyencripto

💠 Usage

1. Encrypt a project

pyencripto encrypt <source_folder> <output_folder> --key <key>

Example:

pyencripto encrypt ./my_project ./my_project_crpt --key secret123

What happens:

  • All .py files are encrypted and saved with .crpt extension
  • The assets/ folder is encrypted and packed into assets.pak

⚠️ The .crpt extension is mandatory! It is used by the module loader.


2. Run an encrypted project

pyencripto run <encrypted_project_folder> <key>

Example:

pyencripto run ./my_project_crpt secret123

The project must contain an encrypted main.crpt file with a main() function.


📁 Project structure

Original project:

my_project/
├── main.py          # contains main()
├── utils/
│   └── helper.py
└── assets/
    └── image.png

After encryption:

my_project_crpt/
├── main.crpt
├── utils/
│   └── helper.crpt
└── assets.pak

🔧 Internal modules

  • encryptor.py — handles project encryption
  • secure_runtime.py — loads .crpt modules and decrypts assets at runtime
  • cli.py — CLI interface (pyencripto encrypt|run)

🧪 Requirements

  • Python 3.10+
  • pycryptodome (automatically installed)

⚠️ Security notes

  • Encryption makes reverse engineering harder but not impossible. Do not treat this as absolute protection.
  • The key is stored only in memory but can be extracted during runtime.

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

pyencripto-1.0.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

pyencripto-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pyencripto-1.0.0.tar.gz.

File metadata

  • Download URL: pyencripto-1.0.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for pyencripto-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c6fab3c83b58d23f3058289b1c33cbecdce0107fd26ef09f00ac83dc7513a149
MD5 0699c917ef18c9c022902ec0185b2462
BLAKE2b-256 33a99aca7aa8fd1680115a42d3ca6b0455030b279a509bfe763267731ef55ec9

See more details on using hashes here.

File details

Details for the file pyencripto-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyencripto-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for pyencripto-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cda7b6cd78c759098ba2fafb1acfab2e41e40bdb46f043e78dab4c0ffb19484
MD5 5ebc946890aaedf4aaef2c74ba76d5eb
BLAKE2b-256 15f8196c85f244816d3c2b61602a40e6762fd143e9b6333c7ae353f064cf599f

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