pyprotect是一个轻量级的python代码保护程序,使你的python项目更难以进行逆向工程

网友投稿 1499 2022-10-27

pyprotect是一个轻量级的python代码保护程序,使你的python项目更难以进行逆向工程

pyprotect是一个轻量级的python代码保护程序,使你的python项目更难以进行逆向工程

pyprotect

pyprotect is a lightweight python code protector, makes your python project harder to reverse engineer.

Features

Cross platformNo need to install any extra dependentsVery easy to use

Only python3.x is supported by current version

How it works?

Build pyprotect

Download pybind11 library:

Create a directory "deps" in pyprotect root directory.Download pybind11 project into the newly created deps directory.Unzip pybind11 zip file, and change the extracted directory's name from something like "pybind11-x.x.x" to "pybind11"

Run these commands in pyprotect root directory:

mkdir buildcd build && cmake .. && make

And you can find libpyprotect.cpython-PYVERSION-PLATFORM.so in the objs directory.

Encrypt your python project

Command:

python encrypt.py -s SCRIPTS_DIR -e ENTRY_POINT_LIST -o OUTPUT_DIR [--exclude EXCLUDED_SCRIPT_LIST]

SCRIPTS_DIR is your python project root directory.ENTRY_POINT_LIST is a comma separated list of file function pair which is directly ran as the entry point of your programme. For example "app.py:main,test_app.py:run_test".OUTPUT_DIR is the destination directory to store the encrypted python scripts.EXCLUDED_SCRIPT_LIST is a comma separated list of python scripts which you don't wan to encrypt.

You need to put libpyprotect.cpython-PYVERSION-PLATFORM.so into the OUTPUT_DIR as part of your programme.

Configuration [IMPORTANT]

For security reason you should change the AES key and IV, which is used to encrypt/decrypt the python scripts, to a stronger value. And you may want to change the file extension of encrypted python scripts (which is ".pye" by default).

You can find these macros or variables in config.h and encrypt.py:

PYPROTECT_KEYPYPROTECT_IVPYPROTECT_EXT_NAME

You need to change the two files both. Please change the PYPROTECT_KEY and PYPROTECT_IV to a safer value.

Roadmap

Support python3 scripts Support python2.7 scripts Anti debugging Software license control

License

pyprotect is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:一文入门Redis
下一篇:白话空间统计二十四:地理加权回归(七)ArcGIS的GWR工具扩展参数说明
相关文章

 发表评论

暂时没有评论,来抢沙发吧~