Skip to content

Python Packer

Obfuscator source code

Transform python source code into obfuscated python code.

PyObfx (Simple use)

  • Obfuscates strings, integers, floats, booleans, variable names, and import names.
  • Compress source code (bz2, gz, lzma).
  • This repository has been archived by the owner on Dec 6, 2020.
git clone https://github.com/PyObfx/PyObfx.git && cd PyObfx
pip install -r requirements.txt
python PyObfx.py app.py -p lzma

PyObfuscate (Simple use)

  • Use Marshal for serializing data.
  • Use Base16/32/64 for encoding.
  • Use Zlib for compression.
git clone https://github.com/htr-tech/PyObfuscate.git && cd PyObfuscate
python encode.py

pyarmor (Moderate use)

  • Seamless Replacement: Obfuscated scripts remain as standard .py files, allowing them to seamlessly replace the original Python scripts in most cases.
  • Balanced Obfuscation: Offers multiple ways to obfuscate scripts to balance security and performance.
  • Irreversible Obfuscation: Renames functions, methods, classes, variables, and arguments.
  • C Function Conversion: Converts some Python functions to C functions and compiles them into machine instructions using high optimization options for irreversible obfuscation.
  • Script Binding: Binds obfuscated scripts to specific machines or sets expiration dates for obfuscated scripts.
  • The free trial version has some limitations.
pip install pyarmor
python -m pyarmor.cli

# Obfuscation Source Code
python -m pyarmor.cli gen app.py
python dist/app.py

Intensio-Obfuscator (Moderate use)

  • Replace all names of variables/classes/functions/files-name to random strings with length defined then all chars to their hexadecimal value.
  • Delete all comments, all spaces lines.
  • Padding random snippets code/functions/classes with an always differents values.
  • Provides a high level obfuscation layer to prevent or delay the reading and understanding of your python program.

Phantom-Evasion (Advanced use)

Phantom-Evasion is an antivirus evasion tool written in python (both compatible with python and python3) capable to generate (almost) fully undetectable executable even with the most common x86 msfvenom payload.

  • This repository has been archived by the owner on Nov 7, 2023.

Convert to executable

pyinstaller

PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules.

  • Ease of Distribution: One of the primary advantages of PyInstaller is its ability to create self-contained executable files.
  • Cross-Platform Compatibility: PyInstaller supports cross-compilation, allowing you to create executables for multiple platforms from a single development environment.
pip install pyinstaller
python -m PyInstaller -F app.py
./dist/app.exe

nuitka

Nuitka translates the Python modules into a C level program that then uses libpython and static C files of its own to execute in the same way as CPython does.

  • All optimization is aimed at avoiding overhead, where it's unnecessary.
  • Smaller file size
pip install -U nuitka
python -m nuitka --standalone --onefile app.py

pyarmor

  • Packing files into one bundle by PyInstaller, py2exe, py2app, cx_Freeze.
  • Themida Protection: Protects obfuscated scripts using Themida (Windows only).
# Obfuscation Source Code And Packed
python -m pyarmor.cli gen --pack onefile .\app.py

More Tools

Resource