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)
### 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
The library is broken up into two parts. The first is `FrameTrackingNodeVisitor` which is an `ast.NodeVisitor` that is used to read an entire file and track all identifier usages and in which scopes they were defined, internally using `FrameTrackingNodeVisitor.Frame` and `FrameTrackingNodeVisitor.FrameEntry`. Public methods then allow querying of this internal representation (TODO: maybe the representation shouldn't be internal to the walker but should output it).
The second part is the `ReleaseObfuscationTransformer` which actually transforms the given AST into the obfuscated AST. It internall creates a `FrameTrackingNodeVisitor` to then query information from.
Metadata
Release files for bobskater 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bobskater-0.0.4.tar.gz | 8.5 kB | Without provenance | Details for bobskater-0.0.4.tar.gz |
Release files / bobskater-0.0.4.tar.gz
| Download URL | bobskater-0.0.4.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72e15d98b25d503ed377d2a4b608e99b9ed6c60c48876165982da7096ea1b20c
|
|
BLAKE2b-256 checksum How to use checksums |
8b79af9ab0d9b2e2069640f744588720f16c4a237e5c2fe2e7a0737c08db7ff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for bobskater 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.