Tool/Library for Python used to obfuscate and protect your code in static and runtime from decompilation, reverse debug, etc. Also, can prevent detection by antiviruses.
- Python 3 up to latest
- Windows
- All Linux distributions
- Mac OS
Static & Runtime Protection
- Total advanced static and runtime protection from decompilation, reverse debug, etc.
Hash Variables
- Hash all variables and constants values in fragment of code.
- Protects variables and constants content.
Recursive obfuscation
- Recurseve encrypt fragment of code using base64 and zlib n times.
- Best way to decrease/prevent antiviruses detection.
Best encryption algorithms
- Fernet, AES-GCM, ChaCha20, Salsa20
- Symmetric cipher which offer strong confidentiality, and provide authentication and integrity to protect against tampering.
File Integrity Protection
- Protect files against modification.
- Advanced file hash/content integrity check and comparison.
- Clone repo
git clone https://github.com/ByteCorum/Py-Shield.git
- Install requirements
pip install -r requirements.txt
- Usage info
py-shield --help
- Example
py-shield obfuscate --hashdata --aes --chacha --follow-imports main.py
- Output
#Obfuscated by Py-Shield 3.0.0.0 from PyShield.script_55958136 import PyShield, _ _(PyShield(b'x\x9c\x05\xc1\xc7\xa2k@\x00\x00\xd0\x0f\xb2P\xa3,\xdeB\...')
- Example legacy
py-shield obfuscatelegacy --loops 3 --mode 2 --file code.py
- Output legacy
_=lambda __:__import__('zlib').decompress(__import__('cryptography.fernet').fernet.Fernet(__import__('base64').b64decode(((__import__('zlib').decompress(__))[::-1].split(b'eY3NTTr:S|dD'))[1])).decrypt(((__import__('zlib').decompress(__))[::-1].split(b'eY3NTTr:S|dD'))[0])[::-1]);exec((_x)(b'x\x9c\x15\x97U\xce\x86\...')
Note
Obfuscation tool has 2 major versions legacy and main. This repo includes both of them, but we highly recommend you to use the main version, cuz it much more secure. Anyway, we won't end support of legacy version, so if u have issues, let us know.
Tip
We highly recommend compiling obfuscated script using Nuitka. Use --follow imports
while obfuscating to tell Nuitka what to import