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 pytransfrom 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.1.zip (2.4 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.1-py2.py3-none-any.whl (2.4 MB view details)

Uploaded Python 2Python 3

File details

Details for the file pyarmor-5.2.1.zip.

File metadata

  • Download URL: pyarmor-5.2.1.zip
  • Upload date:
  • Size: 2.4 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.1.zip
Algorithm Hash digest
SHA256 fc9d1e3750188054433d46f2e370b6dbe0c376b4be166a54a89c29d1b92b0e79
MD5 a4054c06ae752b9aab20e2b9d55c70f4
BLAKE2b-256 19b22325173d52f90bf0d0c1551a9df360f10687ce2f006c384135891b7899c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyarmor-5.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.4 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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f74a941427cf2ad70dfce7c93886fe5e7353c5ecd378b703248f0b1648c1b905
MD5 a590d7cd5a8615130a258c8e9c1e0fdd
BLAKE2b-256 aba0adbc76b7e188a07e28e2dcfa0e3122439ed57e5dfb6b84b3ffe2f2af4dbb

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