GithubHelp home page GithubHelp logo

choupw / pyprotect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ga0/pyprotect

0.0 2.0 0.0 733 KB

A lightweight python code protector, makes your python project harder to reverse engineer

License: BSD 3-Clause "New" or "Revised" License

CMake 1.00% C++ 76.16% C 9.62% Python 13.21%

pyprotect's Introduction

pyprotect

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

Features

  • Cross platform
  • No need to install any extra dependents
  • Very easy to use

Only python3.x is supported by current version

How it works?

how-it-works

Build pyprotect

  1. Create a directory "deps" in pyprotect root directory.
  2. Download pybind11 project into the newly created deps directory.
  3. 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 build
cd 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_KEY
  • PYPROTECT_IV
  • PYPROTECT_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.

pyprotect's People

Contributors

ga0 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.