Python code protection
Project description
Stonefish
Quickstart
Protecting Python packages
If you have a Python package that you'd like to build with Stonefish, make
sure it follows PEP 517 and contains
at least a minimal pyproject.toml
. There, simply replace the your build system
(e.g., setuptools
) with stonefish
:
[build-system]
# requires = ["setuptools"]
# build-backend = "setuptools.build_meta"
requires = ["stonefish"]
build-backend = "stonefish.build_meta"
# ...
# more project metadata if you follow PEP 621
# <https://peps.python.org/pep-0621/>
# (recommended)
# ...
Done! Your project builds are now protected with Stonefish. Try it out with
pip install .
or
(pip install build)
python -m build . --wheel
Protecting standalone Python scripts
If you'd like to project just a single Python file, you
can use the stonefish
command-line utility, e.g.,
stonefish /path/to/file.py
Verification
In [1]: import foobar
In [2]: foobar.some.function??
Signature: foobar.some.function(*args, **kwargs)
Docstring: <no docstring>
File: Dynamically generated function. No source code available.
Type: function
How it works
Stonefish renames private/local variables, minifies, and encrypts the code.
No matter the programming language, all code has to be run on the user's computer eventually. By observing incoming instructions on the CPU, can theoretically be rebuild. That's independent of the programming language. That process is hard, though, and
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for stonefish-0.3.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73897889c5de40886556f4d49ab4229bd5e626de2b86c664e18577da7ffc0a1b |
|
MD5 | d8d40a24ca45bcb22c5da2353521871f |
|
BLAKE2b-256 | a06051a2d87a9af5209afd9b9e06c5322ba7744be2438632d1a08a3e0b2a39d2 |