Skip to content

Protection

PyLocket applies maximum protection to every build automatically. This includes military-grade encryption, anti-reverse-engineering measures, memory protection, and binary hardening. No configuration is needed — every build receives the full protection suite.


What Gets Protected

  • Function bodies: Every Python function, method, and lambda expression
  • Class bodies: All class-level code
  • Module-level code: Top-level module initialization code

What Is Not Protected

  • Non-Python files: Images, configuration files, data files, HTML templates, and other static assets
  • C extension modules: Compiled .pyd and .so files from C/Cython are not modified by PyLocket
  • Function signatures and docstrings: Names, argument lists, and docstrings remain visible in stubs
  • Module names and directory structure: Package layout is preserved

Tip: If you need to protect non-Python data files, encrypt them at the application level and decrypt them within your protected Python code.

Docstrings are visible in protected code

Function signatures and docstrings remain in the stub code after protection. Remove sensitive information (API endpoints, internal notes, passwords, algorithm descriptions) from docstrings before protecting your application.


Module Selection

PyLocket automatically determines which modules to protect. By default, only your application code is protected — standard library modules, PyInstaller internals, and common third-party packages are skipped automatically.

You can override this behavior using the PYLOCKET_FORCE_INCLUDE and PYLOCKET_FORCE_EXCLUDE environment variables.

For the full guide, see Module Selection.


See Also