Text of pypi.org › project › python-obfuscator-virtualizer as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

python-obfuscator-virtualizer · PyPI

Skip to main content python-obfuscator-virtualizer 1.0.0 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. pip install python-obfuscator-virtualizer 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: https://www.pelock.com/products/python-obfuscator/download Multiple programming APIs available: https://www.pelock.com/products/python-obfuscator/api An online obfuscator interface: https://www.pelock.com/python-obfuscator/ 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 label = 'SecretKey' port = 443 def get_sum ( a , b ): return a + b print ( label , port ) r = get_sum ( 11 , 31 ) print ( r ) 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 pip . Run: pip install python-obfuscator-virtualizer or python3 -m pip install python-obfuscator-virtualizer And then add this import to your source code: from pythonobfuscator import PythonObfuscator Installation package is available at https://pypi.org/project/python-obfuscator-virtualizer/ Example of obfuscating Python script source code using default options #!/usr/bin/env python ############################################################################### # # Python Obfuscator WebApi interface usage example. # # In this example we will obfuscate sample source with default options. # # Version : v1.0.0 # Language : Python # Author : Bartosz Wójcik # Web page : https://www.pelock.com # ############################################################################### # # include Python Obfuscator module # from pythonobfuscator import PythonObfuscator # # if you don't want to use Python module, you can import directly from the file # #from pelock.pythonobfuscator import PythonObfuscator # # create Python Obfuscator class instance (we are using our activation key) # myPythonObfuscator = PythonObfuscator ( "ABCD-ABCD-ABCD-ABCD" ) # # source code in Python format # scriptSourceCode = """label = 'SecretKey' port = 443 def get_sum(a, b): return a + b print(label, port) r = get_sum(11, 31) print(r) """ # # by default all obfuscation options are enabled, so we can just simply call # result = myPythonObfuscator . obfuscate_script_source ( scriptSourceCode ) # # it's also possible to pass a Python script file path instead of a string with the source e.g. # # result = myPythonObfuscator.obfuscate_script_file("/path/to/project/script.py") # # result[] array holds the obfuscation results as well as other information # # result["error"] - error code # result["output"] - obfuscated code # result["demo"] - demo mode (empty/invalid key); strategy flags ignored; always integers_to_arrays, mba_binops, encrypt_strings (no virt; 1000 char limit) # result["license_expiration"] - license end date (Y-m-d), empty if none # result["usages_total"] - total obfuscations for this activation code # if result and "error" in result : # display obfuscated code if result [ "error" ] == PythonObfuscator .

ERROR_SUCCESS : # format output code for HTML display print ( result [ "output" ]) else : print ( f 'An error occurred, error code: { result [ "error" ] } ' ) else : print ( "Something unexpected happen while trying to obfuscate the code." ) An example of obfuscating Python script source code with customized obfuscation strategies #!/usr/bin/env python ###################################################

The rest of this page is on the live site.