AST based Obfuscator for Python
Project description
bobskater
An AST based Python obfuscator that robustly mangles names in Python code
Current limitations:
- DOES NOT SUPPORT: Annotations, evals, templated strings
- No configuration but instead takes a cautious approach in determining what identifiers to mangle. Globals, kwargs, class namespace identifiers, and others are not obfuscated but this should be user selected in the future
- It is only tested with Python v3.5 and might not work with other AST versions
- Scoping for comprehensions are kind of hacky (and basically follows Python 2 comprehension scope leaking methodology)
- Doesn't support imports of the form import xxx.yyy, as this ast pattern isn't put into the scope and will bomb out
Installation
pip install bobskater
Usage
from bobskater import obfuscateFile, obfuscateString
#Takes a file path and overwrites it with the obfuscated file
obfuscateFile(filePath)
#Takes a string of Python code and obfuscates it, returning the result
output = obfuscateString(open('myfile.py', 'r').read())
Developing
See CONTRIBUTING.MD
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bobskater-0.1.0.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for bobskater-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bdc65130510a14ae0841c82eaeefe945a5662ae340ced3013647fdc51980a0e |
|
MD5 | 8149c5b2051b0bbc52bbdc635fe30307 |
|
BLAKE2b-256 | 55c708cba3bf3d47918e9ea77602afc8f4ccef978146a17f6075da4e564f8b0a |