Download the PHP package pelock/python-obfuscator without Composer
On this page you can find all versions of the php package pelock/python-obfuscator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pelock/python-obfuscator
More information about pelock/python-obfuscator
Files in pelock/python-obfuscator
Package python-obfuscator
Short Description Python Obfuscator Web API interface can help you obfuscate and protect Python .py source code against analysis, reverse engineering and technology theft. Python Obfuscator provides advanced Python source code parsing based on AST trees, multiple advanced obfuscation, virtualization and protection strategies are available.
License Apache-2.0
Homepage https://www.pelock.com/products/python-obfuscator
Informations about the package python-obfuscator
Python Obfuscator — Obfuscate, Virtualize & Protect Python Code
Python Obfuscator is a tool to obfuscate, virtualize & protect Python .py scripts against reverse engineering with a VM engine (or finite-state automata machine), self-defending integrity checks, polymorphic string encryption, anti-debugging, anti-vm, anti-emulation and 50+ total obfuscation strategies!
It's available for Windows & Linux, plus VSCode/Cursor extension:
Multiple programming APIs available:
An online obfuscator interface:
Why Python scripts need obfuscation?
Scripts are typically distributed as plain .py files or bundled inside packages. That convenience means anyone with file access can read the full logic, hunt for credentials or API keys in strings, and steal your algorithms unless you take extra steps to hide intent.
Python is one of the most popular general-purpose scripting languages. It is widely used for automation, backend services, data processing, tooling, and licensing/agent code that customers run on their own machines.
Obfuscation strategies
Python Obfuscator comes with many advanced obfuscation, virtualization & protection strategies. You can easily tune protection versus size and performance.

Powerful obfuscation
Polymorphic string encryption is the core of the string pipeline: each build generates a fresh decryptor so literals never share one static algorithm. Integers, floats, and decoy noise join that layer. The result conceals literals and structure while preserving tested runtime behaviour.
Code virtualization
Code virtualization is the main control-flow defense. Selected statements are lifted into a randomly generated VM engine (or FSA / flattened dispatcher) with shuffled dispatch tables, decoy opcodes, and an obfuscated dispatcher loop. Analysts must interpret the virtual machine instead of reading plain Python.
Finite-state automata (FSA)
Finite-state automata (FSA) obfuscation rewrites linear Python statement blocks into dual-state automata with opaque schedulers and shuffled dispatch handlers. Instead of reading code top to bottom, analysts must follow numeric states, transition tables, and decoy paths to reconstruct the original order.
Anti-debugging
Anti-debugging protection inserts polymorphic probes that detect attached debuggers, tracing hooks, and related host signals, together with anti-VM, anti-sandbox and anti-emulator checks. When a check fires, the obfuscated script exits silently instead of revealing protected logic under interactive analysis.
Self-integrity checks
Self-defending integrity checks verify that the obfuscated file has not been patched. A bootstrap probe hashes the on-disk script and sets a tamper key when it no longer matches the obfuscated build. String decryptors consume that key, so edited scripts return garbage instead of plaintext.
Protection linker
The protection linker adds decoy functions and fake calls so a copied fragment still looks like real program code. Hidden traps fire only if someone edits the file or runs a piece of it on its own. When the script starts normally, those extras stay silent and the program runs as usual.
Before and after obfuscation
Look at this example — the same script becomes harder to read at a glance after obfuscation.
Sample Python script before obfuscation
After obfuscation

Would you still recognise the original intent if you only had the obfuscated text and no prior copy of the script?
How does Python Obfuscator work?
The engine parses Python source into an AST tree, then applies selectable transforms. Code virtualization (VM, FSA, or flattening) rewrites execution so analysts cannot read the script top to bottom. Polymorphic string encryption hides literals; self-defending integrity probes detect patched files. Also available: identifier renaming, numeric encryption, noise and decoy insertion, the protection linker, and anti-debugging checks. Many techniques are specific to this product; some ideas are shared with our other protection tools.

When all passes finish, the engine emits a new .py file. Edge cases in the Python grammar and hosting environments mean you should always test the output in your target runtime.
Protect your Python scripts & algorithms
Take no chances, use Python Obfuscator to obfuscate, virtualize and protect your Python scripts and algorithms.
Our company has a long history in obfuscation technologies and code obfuscators (see our PowerShell, Java, AutoIt, x86 Assembly & obfuscators).
We actively bugfix, research and develop new obfuscation strategies for our tools.
You can count on our expertise and support in this field.
Installation
The preferred way of WebApi interface installation is via Composer.
Run:
And then add this import to your source code:
The package listing on Packagist will be at https://packagist.org/packages/pelock/python-obfuscator after publishing.
If you don't want to use Composer, just copy the src/PythonObfuscator.php file into your project and use include_once:
Example of obfuscating Python script source code using default options
An example of obfuscating Python script source code with customized obfuscation strategies
Check activation key status
Skip selected functions and classes
Use the Python Obfuscator Decorator package to mark functions and classes that should skip chosen strategies. You need it only to run original source. The obfuscator reads @obfuscator.skip from the AST, applies the skip, then strips the decorator and unused import obfuscator lines. Obfuscated output has no runtime dependency on this package.
Package on PyPI: https://pypi.org/project/python-obfuscator-decorator/
Installation
or
Import package name: obfuscator. PyPI distribution name: python-obfuscator-decorator.
Simple usage
Also valid:
@obfuscator.skip(obfuscator.ENCRYPT_STRINGS, obfuscator.CODE_VIRTUALIZATION)— skip listed strategies@obfuscator.skip("encrypt_strings")— string keys match engine strategy names@obfuscator.skip(bare, no call) — skip every mutating strategy on that constructimport obfuscator as aliasthen@alias.skip(...)
CODE_VIRTUALIZATION skips all virtualization modes (VM, FSA, flatten) on that function or class.
Use Python Obfuscator Online
Online interface for Python Obfuscator is available at:
https://www.pelock.com/python-obfuscator/
Windows GUI client and command line version
You can download it at:
https://www.pelock.com/products/python-obfuscator/download
Python Obfuscator comes also with full GUI version for Windows

Obfuscation options

Command line interface aka CLI
Python Obfuscator ships with a command-line interface for Windows and Linux automation. Use it to integrate obfuscation into build servers, CI jobs, or batch packaging.

Demo mode limitations
In demo mode the obfuscator always applies integers_to_arrays, mba_binops, and encrypt_strings (no code virtualization). Source size is limited to 1000 characters.
Bartosz Wójcik
- Visit my site at — https://www.pelock.com
- X — https://x.com/PELock
- GitHub — https://github.com/PELock
All versions of python-obfuscator with dependencies
ext-zlib Version *
ext-json Version *
ext-curl Version *