Changelogs » Pyarmor



* Refine error message when checking license failed
* Fix issue: protection code raises ImportError in the package file `__init.py__`


* Improve the security of dynamic library.


* Fix issue: in restrict mode the bootstrap code in `` will raise exception.
* Add option `--cross-protection` in command `obfuscate`


* Use global capsule as default capsule for project, other than creating new one for each project
* Add option `--obf-code`, `--obf-mod`, `--wrap-mode`, `--cross-protection` in command `config`
* Add new attributes for project: `obf_code`, `obf_mod`, `wrap_mode`, `cross_protection`
* Deprecrated project attributes `obf_code_mode`, `obf_module_mode`, use `obf_code`, `obf_mod`, `wrap_mode` instead
* Change the behaviours of `restrict mode`, refer to
* Change option `--restrict` in command `obfuscate` and `licenses`
* Remove option `--no-restrict` in command `obfuscate`
* Remove option `--clone` in command `init`


* Improve the security of PyArmor self

5.1.1 insecure

* Refine the procedure of encrypt script
* Reform module ``
* Fix issue: it will raise exception if no entry script when obfuscating scripts
* Fix issue: 'gbk' codec can't decode byte 0xa1 in position 28 (51)
* Add option `--upgrade` for command `capsule`
* Merge runtime files `pyshield.key`, `pyshield.lic` and `product.key` into `pytransform.key`

**Upgrade notes**

The capsule created in this version will include a new file
`pytransform.key` which is a replacement for 3 old runtime files:
`pyshield.key`, `pyshield.lic` and `product.key`.

The old capsule which created in the earlier version still works, it
stills use the old runtime files. But it's recommended to upgrade the
old capsule to new version. Just run this command::

pyarmor capsule --upgrade

All the license files generated for obfuscated scripts by old capsule
still work, but all the scripts need to be obfuscated again to take
new capsule effects.

5.1.0 insecure

* Add extra code to protect dynamic library `_pytransform` when obfuscating entry script
* Fix compling error when obfuscating scripts in windows for Python 26/30/31 (newline issue)

5.0.5 insecure

* Refine `protect_pytransform` to improve security, refer to

5.0.4 insecure

* Fix `get_expired_days` issue, remove decorator `dllmethod`
* Refine output message of `pyarmor -v`

5.0.3 insecure

* Add option `-q`, `--silent`, suppress all normal output when running any PyArmor command
* Refine runtime error message, make it clear and more helpful
* Add new function `get_hd_info` in module `pytransform` to get hardware information
* Remove function `get_hd_sn` from module `pytransform`, use `get_hd_info` instead
* Remove useless function `version_info`, `get_trial_days` from module `pytransform`
* Remove attribute `lib_filename` from module `pytransform`, use `_pytransform._name` instead
* Add document
* Refine document

5.0.2 insecure

* Export `lib_filename` in the module pytransform in order to protect
dynamic library `_pytransform`.  Refer to

5.0.1 insecure


Thanks to GNU lightning, from this version, the core routines are
protected by JIT technicals. That is to say, there is no binary code
in static file for core routines, they're generated in runtime.

Besides, the pre-built dynamic library for linux arm32/64 are packed
into the source package.

Fixed issues:

* The module `multiprocessing` starts new process failed in obfuscated script:

`AttributeError: '__main__' object has no attribute 'f'`

4.6.3 insecure

* Fix backslash issue when running `pack` command with `PyInstaller`
* When PyArmor fails, if `sys.flags.debug` is not set, only print error message, no traceback printed

4.6.2 insecure

* Add option `--options` for command `pack`
* For Python 3, there is no new line in the output when `pack` command fails

4.6.1 insecure

* Fix license issue in 64-bit embedded platform

4.6.0 insecure

* Fix crash issue for special code object in Python 3.6

4.5.5 insecure

* Fix stack overflow issue

4.5.4 insecure

* Refine platform name to search dynamic library `_pytransform`

4.5.3 insecure

* Print the exact message when checking license failed to run obfuscated scripts.

4.5.2 insecure

* Add documentation
* Exclude `dist`, `build` folder when executing `pyarmor obfuscate --recursive`

4.5.1 insecure

* Fix 41: can not find dynamic library `_pytransform`

4.5.0 insecure

* Add anti-debug code for dynamic library `_pytransform`

4.4.2 insecure

This patch mainly changes webui, make it simple more:

* WebUI : remove source field in tab Obfuscate, and remove ipv4 field in tab Licenses
* WebUI Packer: remove setup script, add output path, only support PyInstaller

4.4.1 insecure

* Support Py2Installer by a simple way
* For command `obfuscate`, get default `src` and `entry` from first argument, `--src` is not required.
* Set no restrict mode as default for new project and command `obfuscate`, `licenses`

4.4.0 insecure


* Pack obfuscated scripts by command `pack`

In this version, introduces a new command `pack` used to pack
obfuscated scripts with `py2exe` and `cx_Freeze`. Once the setup
script of `py2exe` or `cx_Freeze` can bundle clear python scripts,
`pack` could pack obfuscated scripts by single command: `pyarmor
pack --type cx_Freeze /path/to/src/`

* Pack obfuscated scripts by WebUI packer

WebUI is well reformed, simple and easy to use.

4.3.4 insecure

* Fix start pyarmor issue for `pip install` in Python 2

4.3.3 insecure

* Fix issue: missing file in wheel

4.3.2 insecure

* Fix `pip` install issue in MacOS
* Refine sample scripts to make workaround for py2exe/cx_Freeze simple

4.3.1 insecure

* Fix typos in examples
* Fix bugs in sample scripts

4.3.0 insecure

In this version, there are three significant changes:

[Simplified WebUI](
[Clear Examples](src/examples/, quickly understand the most features of Pyarmor
[Sample Shell Scripts](src/examples), template scripts to obfuscate python source files

* Simply webui, easy to use, only input one filed to obfuscate python scripts
* The runtime files will be always saved in the same path with obfuscated scripts
* Add shell scripts `obfuscate-app`, `obfuscate-pkg`,
`build-with-project`, `build-for-2exe` in `src/examples`, so that
users can quickly obfuscate their python scripts by these template
* If entry script is ``, change the first line of bootstrap
code `from pytransform import pyarmor runtime` to `from .pytransform
import pyarmor runtime`
* Rewrite examples/, make it clear and easy to understand
* Do not generate entry scripts if only runtime files are generated
* Remove choice `package` for option `--type` in command `init`, only `pkg` reserved.

4.2.3 insecure

* Fix `pyarmor-webui` can not start issue
* Fix `runtime-path` issue in webui
* Rename platform name `macosx_intel` to `macosx_x86_64` (36)

4.2.2 insecure

* Fix webui import error.

4.2.1 insecure

* Add option `--recursive` for command `obfuscate`

4.1.4 insecure

* Rewrite project long description.

4.1.3 insecure

* Fix Python3 issue for `get_license_info`

4.1.2 insecure

* Add function `get_license_info` in `` to show license information

4.1.1 insecure

* Fix import `main` from `pyarmor` issue

4.0.3 insecure

* Add command `capsule`
* Find default capsule in the current path other than `--src` in command `obfuscate`
* Fix pip install issue 30

4.0.2 insecure

* Rename `` to ``
* Rename `` to ``
* Add option `--capsule`, `-disable-restrict-mode` and `--output` for command `licenses`

4.0.1 insecure

* Add option `--capsule` for command `init`, `config` and `obfuscate`
* Deprecate option `--clone` for command `init`, use `--capsule` instead
* Fix `sys.settrace` and `sys.setprofile` issues for auto-wrap mode

3.9.9 insecure

* Fix segmentation fault issues for `asyncio`, `typing` modules

3.9.8 insecure

* Add documentation for examples (examples/

3.9.7 insecure

* Fix windows 10 issue: access violation reading 0x000001ED00000000

3.9.6 insecure

* Fix the generated license bind to fixed machine in webui is not correct
* Fix extra output path issue in webui

3.9.5 insecure

* Show registration code when printing version information

3.9.4 insecure

* Rewrite long description of package in pypi

3.9.3 insecure

* Fix issue: `__file__` is not really path in main code of module when import obfuscated module

3.9.2 insecure

* Replace option `--disable-restrict-mode` with `--no-restrict` in command `obfuscate`
* Add option `--title` in command `config`
* Change the output path of entry scripts when entry scripts belong to package
* Refine document `` and ``

3.9.1 insecure

* Add option `--type` for command `init`
* Refine document `` and ``

3.9.0 insecure

This version introduces a new way `auto-wrap` to protect python code when it's imported by outer scripts.

Refer to [Mechanism Without Restrict Mode](src/mechanism.mdmechanism-without-restrict-mode)

* Add new mode `wrap` for `--obf-code-mode`
* Remove `func.__refcalls__` in `__wraparmor__`
* Add new project attribute `is_package`
* Add option `--is-package` in command `config`
* Add option `--disable-restrict-mode` in command `obfuscate`
* Reset `build_time` when project configuration is changed
* Change output path when `is_package` is set in command `build`
* Change default value of project when find `` in comand `init`
* Project attribute `entry` supports absolute path

3.8.10 insecure

* Fix shared code object issue in `__wraparmor__`

3.8.9 insecure

* Clear frame as long as `tb` is not `Py_None` when call `__wraparmor__`
* Generator will not be obfucated in `__wraparmor__`

3.8.8 insecure

* Fix bug: the `frame.f_locals` still can be accessed in callback function

3.8.7 insecure

* The `frame.f_locals` of `wrapper` and wrapped function will return an empty dictionary once `__wraparmor__` is called.

3.8.6 insecure

* The `frame.f_locals` of `wrapper` and wrapped function return an empty dictionary, all the other frames still return original value.

3.8.5 insecure

* The `frame.f_locals` of all frames will always return an empty dictionary to protect runtime data.
* Add extra argument `tb` when call `__wraparmor__` in decorator `wraparmor`, pass None if no exception.

3.8.4 insecure

* Do not touch `frame.f_locals` when raise exception, let decorator `wraparmor` to control everything.

3.8.3 insecure

* Fix issue: option `--disable-restrict-mode` doesn't work in command `licenses`
* Remove freevar `func` from `frame.f_locals` when raise exception in decorator `wraparmor`

3.8.2 insecure

* Change module filename to `<frozen modname>` in traceback, set attribute `__file__` to real filename when running obfuscated scripts.

3.8.1 insecure

* Try to access original func_code out of decorator `wraparmor` is forbidden.

3.8.0 insecure

* Add option `--output` for command `build`, it will override the value in project configuration file.
* Fix issue: defalut project output path isn't relative to project path.
* Remove extra file "product.key" after obfuscating scripts.

3.7.5 insecure

* Remove dotted name from filename in traceback, if it's not a package.

3.7.4 insecure

* Strip `__init__` from filename in traceback, replace it with package name.

3.7.3 insecure

* Remove brackets from filename in traceback, and add dotted prefix.

3.7.2 insecure

* Change filename in traceback to `<frozen [modname]>`, other than original filename

3.7.1 insecure

* Fix issue 12: module attribute `__file__` is filename in build machine other than filename in target machine.
* Builtins function `__wraparmor__` only can be used in the decorator `wraparmor`

3.7.0 insecure

* Fix issue 11: use decorator "wraparmor" to obfuscate func_code as soon as function returns.
* Document usage of decorator "wraparmor",  refer to **src/user-guide.mduse-decorator-to-protect-code-objects-when-disable-restrict-mode**

3.6.2 insecure

* Fix issue 8 (Linux): option --manifest broken in shell script

3.6.1 insecure

* Add option "Restrict Mode" in web ui
* Document restrict mode in details (

3.6.0 insecure

* Introduce restrict mode to avoid obfuscated scripts observed from no obfuscated scripts
* Add option --disable-restrict-mode for command "config"

3.5.1 insecure

* Support pip install pyarmor

3.5.0 insecure

* Fix Python3.6 issue: can not run obfuscated scripts, because it uses a 16-bit wordcode instead of bytecode
* Fix Python3.7 issue: it adds a flag in pyc header
* Fix option --obf-module-mode=none failed
* Add option --clone for command "init"
* Generate runtime files to separate path “runtimes" when project runtime-path is set
* Add advanced usages in user-guide

3.4.3 insecure

* Fix issue: raise exception when project entry isn't obfuscated

3.4.2 insecure

* Add webui to manage project

3.4.1 insecure

* Fix README.rst format error.
* Add title attribute to project
* Print new command help when option is -h, --help


use command **obfuscate** to obfuscate scripts directly. For
complicated package, use Project to manage obfuscated scripts.

Project includes 2 files, one configure file and one project
capsule. Use manifest template string, same as of Python
Distutils, to specify the files to be obfuscated.

To create a project, use command **init**, use command **info** to
show project information. **config** to update project settings, and
**build** to obfuscate the scripts in the project.

Other commands, **benchmark** to metric performance, **hdinfo** to
show hardware information, so that command **licenses** can generate
license bind to fixed machine.

All the old commands **capsule**, **encrypt**, **license** are
deprecated, and will be removed from v4.

A new document [src/](src/ is written for
this new version.

3.4.0 insecure


3.3.1 insecure

* Remove unused files in distribute package

3.3.0 insecure

In this version, new obfuscate mode 7 and 8 are introduced. The main
difference is that obfuscated script now is a normal python file (.py)
other than compiled script (.pyc), so it can be used as common way.

Refer to

* Introduce new mode: 7, 8
* Change default mode from 3 to 8
* Change to test new mode
* Update webapp and tutorial
* Update usage
* Fix issue of py2exe, now py2exe can work with python scripts obfuscated by pyarmor
* Fix issue of odoo, now odoo can load python modules obfuscated by pyarmor

3.2.1 insecure

* Fix issue: the traceback of an exception contains the name "<pytransform>" instead of the correct module name
* Fix issue: All the constant, co_names include function name, variable name etc still are in clear text.
Refer to

3.2.0 insecure

From this version, a new obfuscation mode is introduced. By this way,
no import hooker, no setprofile, no settrace required. The performance
of running or importing obfuscation python scripts has been remarkably
improved. It's significant for Pyarmor.

* Use this new mode as default way to obfuscate python scripts.
* Add new script "" to check performance in target machine: python
* Change option "--bind-disk" in command "license",  now it must be have a value

3.1.7 insecure

* Add option "--bind-mac", "--bind-ip", "--bind-domain" for command "license"
* Command "hdinfo" show more information(serial number of hdd, mac address, ip address, domain name)
* Fix the issue of dev name of hdd for Banana Pi

3.1.6 insecure

* Fix serial number of harddisk doesn't work in mac osx.

3.1.5 insecure

* Support MACOS

3.1.4 insecure

* Fix issue: load _pytransfrom failed in linux x86_64 by subprocess.Popen
* Fix typo in error messge when load _pytransfrom failed.

3.1.3 insecure

A web gui interface is introduced as Pyarmor WebApp, and support

* In encrypt command, save encrypted scripts with same file structure of source.
* Add a web gui interface for pyarmor.
* Support to list files for command encrypt
* Add option --manifest, file list will be written here
* DO NOT support absolute path in file list for command encrypt
* Option --main support format ""

3.1.2 insecure

* Refine decrypted mechanism to improve performance
* Fix unknown opcode problem in recursion call
* Fix wrapper scripts generated by -m in command 'encrypt' doesn't work
* Raise ImportError other than PytransformError when import encrypted module failed

3.1.1 insecure

In this version, introduce 2 extra encrypt modes to improve
performance of encrypted scripts.

* Fix issue when import encrypted package
* Add encrypted mode 2 and 3 to improve performance
* Refine module pyimcore to improve performance

3.0.1 insecure

It's a milestone for Pyarmor, from this version, use ctypes import
dynamic library of core functions, other than by python extensions
which need to be built with every python version.

Besides, in this version, a big change which make Pyarmor could avoid
soure script got by c debugger.

* Use ctypes load core library other than python extentions which need
built for each python version.
* "\__main__" block not running in encrypted script.
* Avoid source code got by c debugger.
* Change default outoupt path to "build" in command "encrypt"
* Change option "--bind" to "--bind-disk" in command "license"
* Document usages in details

2.6.1 insecure

* Fix encrypted scripts don't work in multi-thread framework (Django).

2.5.5 insecure

* Add option '-i' for command 'encrypt' so that the encrypted scripts will be saved in the original path.


* Verbose tracelog when checking license in trace mode.
* In license command, change default output filename to "license.lic.txt".
* Read bind file when generate license in binary mode other than text mode.

2.5.3 insecure

* Fix problem when script has line "from __future__ import with_statement"
* Fix error when running pyarmor by 32bit python on the 64bits Windows.
* (Experimental)Support darwin_15-x86_64 platform by adding extensions/

2.5.2 insecure

* License file can mix expire-date with fix file or fix key.
* Fix log error: not enough arguments for format string

2.5.1 insecure

* License file can bind to ssh private key file or any other fixed file.

2.4.1 insecure

* Change default extension ".pyx" to ".pye", because it confilcted with CPython.
* Custom the extension of encrypted scripts by os environment variable: PYARMOR_EXTRA_CHAR
* Block the hole by which to get bytescode of functions.

2.3.4 insecure

* The trial license will never be expired (But in trial version, the
key used to encrypt scripts is fixed).

2.3.3 insecure

* Refine the document

2.3.2 insecure

* Fix error data in examples of wizard

2.3.1 insecure

* Implement Run function in the GUI wizard
* Make license works in trial version

2.2.1 insecure

* Add a GUI wizard
* Add examples to show how to use pyarmor

2.1.2 insecure

* Fix syntax-error when run/import encrypted scripts in linux x86_64

2.1.1 insecure

* Support armv6

2.0.1 insecure

* Add option '--path' for command 'encrypt'
* Support script list in the file for command 'encrypt'
* Fix issue to encrypt an empty file result in pytransform crash

1.7.7 insecure


* Add option '--expired-date' for command 'license'
* Fix undefined 'tfm_desc' for arm-linux
* Enhance security level of scripts

1.7.6 insecure


* Print exactaly message when pyarmor couldn't load extension

* Fix problem "version 'GLIBC_2.14' not found"

* Generate "license.lic" which could be bind to fixed machine.

1.7.5 insecure


* Add missing extensions for linux x86_64.

1.7.4 insecure


* Add command "licene" to generate more "license.lic" by project

1.7.3 insecure


* Add information for using registration code

1.7.2 insecure


* Add option --with-extension to support cross-platform publish.
* Implement command "capsule" and add option --with-capsule so that we
can encrypt scripts with same capsule.
* Remove command "convert" and option "-K/--key"

1.7.1 insecure


* Encrypt pyshield.lic when distributing source code.

1.7.0 insecure


* Enhance encrypt algorithm to protect source code.
* Developer can use custom key/iv to encrypt source code
* Compiled scripts (.pyc, .pyo) could be encrypted by pyshield
* Extension modules (.dll, .so, .pyd) could be encrypted by pyshield