PyArmor

A command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

How to Do Quick Start

Seamless Replacement

The obfuscated script is a normal python script. With an extra extension module pytransform, the plain Python scripts can be replaced with obfuscated ones seamlessly

And PyArmor works well with py2exe, py2app, PyInstaller, cx_Freeze etc.

Runtime Obfuscation

The byte code of each code object will be obfuscated as soon as code object completed execution, and f_locals of frame is cleared at the same time

Pack Obfuscated Scripts

PyArmor could pack obfuscated scripts into one bundle with PyInstaller

Different Licenses

Expire obfuscated scripts

PyArmor can set expired date for obfuscated scripts. After that, obfuscated scripts can not be run

Bind to fixed machine

PyArmor can bind obfuscated scripts to serial number of harddisk, mac address of network card, ip address etc..

Extend other license type

The obfuscated script is black box for end user, add any authentation code in your Python script

Supported Platforms

More information

Windows

Linux

MacOS

Embedded System

PyArmor Provides High Security by JIT and Cross Protection TechnicalsLearn More

Quick Start

Install PyArmor

The easy way is by pip

pip install pyarmor
Obfuscate Scripts

Obfuscate script foo.py and all the other .py files in the current path, save all the obfuscated scripts to folder dist

pyarmor obfuscate foo.py
Run Obfuscated Scripts

Run obfuscated script dist/foo.py as normal Python script

cd dist
python foo.py
Generate Different Licenses

First get hardware information by command hdinfo

Then generate a new license with command licenses

Next obfuscate the scripts with new license

Finally run obfuscated script with new license

pyarmor hdinfo

pyarmor licenses \
        --expired "2018-12-31" \
        --bind-disk "100304PBN2081SF3NJ5T" \
        --bind-mac "70:f1:a1:23:f0:94" \
        --bind-ipv4 "202.10.2.52" \
        r001

pyarmor obfuscate --with-license licenses/r001/license.lic foo.py

cd dist
python foo.py
            
Pack Obfuscated Scripts

Obfuscate the script foo.py , then bundle all the required files into one folder with an executable file dist/foo/foo.exe

pyarmor pack foo.py
WebUI

It will start a light weight web server in localhost, and open a page in web browser(snapshots).

pip install pyarmor-webui
pyarmor-webui