Skip to main content

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

Project description

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 co_code of each function (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.

Look at what happened after foo.py is obfuscated by PyArmor. Here are the files list in the output path dist:

foo.py

_pytransform.so, or _pytransform.dll in Windows, or _pytransform.dylib in MacOS
pytransform.py
pytransform.key
license.lic

dist/foo.py is obfuscated script, the content is:

from pytransform import pyarmor_runtime
pyarmor_runtime()

__pyarmor__(__name__, __file__, b'\x06\x0f...', 1)

All the other extra files called Runtime Files, which are required to run or import obfuscated scripts. So long as runtime files are in any Python path, obfuscated script dist/foo.py can be used as normal Python script.

The original python scripts can be replaced with obfuscated scripts seamlessly.

For details to visit protect-python-scripts-by-pyarmor.md

Support Platforms

  • Python 2.5, 2.6, 2.7 and Python3

  • win32, win_amd64, linux_i386, linux_x86_64, macosx_x86_64

  • Embedded Platform: Raspberry Pi, Banana Pi, Orange Pi, TS-4600 / TS-7600

Quick Start

Install:

pip install pyarmor

Obfuscate scripts:

pyarmor obfuscate examples/simple/queens.py

Run obfuscated scripts:

cd dist
python queens.py

Pack obfuscated scripts with PyInstaller, py2exe, cx_Freeze etc.:

pip install pyinstaller
pyarmor pack examples/py2exe/hello.py

Generate an expired license and run obfuscated scripts with new license:

pyarmor licenses --expired 2018-12-31 Customer-Jondy
cp licenses/Customer-Jondy/license.lic dist/

cd dist/
python queens.py

Start webui, open web page in browser for basic usage of PyArmor:

pyarmor-webui

More Resources

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyarmor-5.2.8.zip (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyarmor-5.2.8-py2.py3-none-any.whl (2.2 MB view details)

Uploaded Python 2Python 3

File details

Details for the file pyarmor-5.2.8.zip.

File metadata

  • Download URL: pyarmor-5.2.8.zip
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.8.1 setuptools/2.1 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.4.2

File hashes

Hashes for pyarmor-5.2.8.zip
Algorithm Hash digest
SHA256 892136b6c64fc5d8a485f55512361955e55da90d6951d8b31e4fa10e0608ae52
MD5 c2e8c67598a50c9235e9aaa00a923d01
BLAKE2b-256 ebdf6c4f1035a19f1cd7340867a613d6d221202181734b5207371d23545138ec

See more details on using hashes here.

File details

Details for the file pyarmor-5.2.8-py2.py3-none-any.whl.

File metadata

  • Download URL: pyarmor-5.2.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.8.1 setuptools/2.1 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.4.2

File hashes

Hashes for pyarmor-5.2.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eab9dcc38563820c4c6b7261d97347554bcf85f00371268e51c72f0f210d00b0
MD5 b6f186e06d84cc02a2666f19c9f8ad2b
BLAKE2b-256 8007d56fb5aa8ff213bd7876c91b5a32d6900bbb61d590aaba4b28e13ad72e18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page