Curated list of mental gems and streams to fuel your cognition
Winner by a wide margin is pyarmor
It is able to obfuscate large codebase with complex dependencies like scipy, gensim, cython, scikit-learn.
Supports latest python3 syntax and std library.
Runtime performance remains unaffected or not by a visible margin.
All project .py files contents unreadable:
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\........
Build docker image with your source code been obfuscated during build.Assuming entry point to your microservice is the main.py
FROM python:3
COPY . /code/
# protect source code with pyarmor
RUN pip3 install pyarmor==5.6.6 \
&& pyarmor obfuscate /code/main.py \
&& rm -rf /code/ && mv dist /code
# cleanup unused files
RUN cd /code && rm -rf Dockerfile *.pyc *.pyo *.pye *.md
Don’t forget to quash docker layers to remove “deleted” files in intermediate layers (unobfuscated python sources, dockerfiles, .py etc)
docker build --squash .
Python bytecode decompilers.