Skip to content

pythonthings/pyarmor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

952 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyarmor

Pyarmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts. It protects Python scripts by the following ways:

  • Obfuscate code object to protect constants and literal strings.
  • Obfuscate byte code of each code object in runtime.
  • Clear f_locals of frame as soon as code object completed execution.
  • Verify the license file of obfuscated scripts while running it.

Refer to Protect Python Scripts By Pyarmor

Support Platforms

  • Python 2.5, 2.6, 2.7 and Python3
  • Prebuilt Platform: win32, win_amd64, linux_i386, linux_x86_64, macosx_x86_64
  • Embedded Platform: Raspberry Pi, Banana Pi, TS-4600 / TS-7600

Quick Start

Installation

The simple way is pip

    pip install pyarmor

Or get source package from pypi/pyarmor

Pyarmor is a command line tool, main script is pyarmor.py. After you get source package, unpack it to any path, then run paramor.py as common python script

    python pyarmor.py

If Pyarmor is installed by pip, there is a command will be avaiable in Python script path

    pyarmor

And there is a webui used to obfuscate script in gui mode:

    pyarmor-webui

Note that the webui doesn't include all the features of Pyarmor, it can help you to understand Pyarmor quickly.

Basic Usage

The following examples show how to obfuscate a python package pybench, which locates in the examples/pybench in the source of pyarmor.

Obfuscate package pybench directly:

python pyarmor.py obfuscate --recursive --src examples/pybench --entry pybench.py

# This command will create an extra file .pyarmor_capsule.zip in the
# current path, and save all the obfuscated scripts to default output
# path "dist"
#
cd dist

# Check obfuscated script
cat pybench.py

# Run obfuscated script
python pybench.py

Use project to manage obfuscated scripts:

python pyarmor.py init --src examples/pybench --entry pybench.py projects/pybench

# This command will create 2 files: .pyarmor_config, .pyarmor_capsule.zip
# in the project path "projects/pybench"
cd projects/pybench

# And there is a shell script "pyarmor" is created at the same time.
# (In windows, the name is "pyarmor.bat")
#
# Now run command "build" to obfuscated all the scripts
#
./pyarmor build

# Check obfuscated script
cd dist
cat pybench.py

# Run obfuscated script
python pybench.py

Pack obfuscated scripts with py2exe, cx_Freeze etc. The setup script of py2exe or cx_Freeze must be exists to run this command

python pyarmor.py pack -t py2exe examples/py2exe/hello.py

More usage, refer to User Guide

License

Pyarmor is published as shareware. Free trial version never expires, the limitation is

  • Project Capsule generated by trial version is NOT random, but FIXED by hardcode.

A registration code is required to generate random project capsule.

  • Personal user: one registration code is enough.
  • Company user: one registration code is only used for one project/product.

For details, refer to LICENSE.

Purchase

Click Purchase,

A registration code will be sent to your immediately after payment is completed successfully.

After you receive the email which includes registration code, copy registration code only (no newline), then replace the content of "license.lic" with it.

Check License

    python pyarmor.py --version

The registration code is valid forever, it can be used permanently.

Any question feel free email to jondy.zhao@gmail.com, or click here to report an issue

About

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

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-ZH

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 78.7%
  • Shell 19.3%
  • Batchfile 1.5%
  • Other 0.5%