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

This version

5.3.2

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.3.2.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.3.2-py2.py3-none-any.whl (2.2 MB view details)

Uploaded Python 2Python 3

File details

Details for the file pyarmor-5.3.2.zip.

File metadata

  • Download URL: pyarmor-5.3.2.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.3.2.zip
Algorithm Hash digest
SHA256 cc6365d3b50b2fb98e1b9fe941e6b75cebbb3f6c9e03fba430f63bce0e9a41a9
MD5 ece1debbe0b03ccfd6f9427ee8274987
BLAKE2b-256 e8d9a32c7a25aa8661c7f87ea510cfa7b15ae75474abee1cec9970000c1357f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyarmor-5.3.2-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.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5da36281596f366c41c2a8e0525e765823cfa6249f20275d71cf045ca650e589
MD5 cb96e46bf90a1843c89d17ad4b709cc6
BLAKE2b-256 8d2bdc77862d909bd9863e6d8635ef8a179e91f846bef4935d01fa2de43723b6

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