Skip to content

davidteather/python-obfuscator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4d9c7b4 · Jul 27, 2023

History

24 Commits
Dec 6, 2020
Dec 6, 2020
Dec 6, 2020
Dec 1, 2020
Dec 6, 2020
Dec 9, 2020
Jul 27, 2023
Feb 21, 2021

Repository files navigation

Python-Obfuscator

One night I got bored of writing good code, so I made good code to make bad code.

GitHub release (latest by date) Downloads Linkedin

DONT USE IN PRODUCTION

I just made this because it was interesting to me. I do plan on making this more official in the future, but currently don't have the time!

Consider sponsoring me here

Installing

pip install python-obfuscator

Quickstart

Print out obfuscated code

pyobfuscate -i your_file.py

Apply changes to the input file

pyobfuscate -i your_file.py -r True

More Detailed Documentation

You can use this as a module if you want

import python_obfuscator
obfuscator = python_obfuscator.obfuscator()

code_to_obfuscate = "print('hello world')"

You can also exclude certain techniques applied for obfuscation

import python_obfuscator
from python_obfuscator.techniques import add_random_variables
obfuscator = python_obfuscator.obfuscator()

code_to_obfuscate = "print('hello world')"
obfuscated_code = obfuscator.obfuscate(code_to_obfuscate, remove_techniques=[add_random_variables])

Find a list of all techniques here

Example Obfuscated Code

Input

y = input("what's your favorite number")

user_value = int(y)
print("{} that's a great number!".format(user_value))

With pyobfuscate -i file.py

With --one-liner True

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details