CodeShade is a Python tool to obfuscate your scripts for security and privacy. It can transform Python code into Base64 or emoji-based representations and obfuscate Bash scripts using bash-obfuscate.
-
Obfuscate Python scripts to Base64 variables.
-
Obfuscate Python scripts to emoji sequences.
-
Obfuscate Bash scripts using bash-obfuscate.
-
Interactive menu for easy use in the terminal.
-
Command-line support for automated workflows.
- Obfuscation works on all systems.
- Needs Python 3.10+.
- To create obfuscated Bash files you need Node/npm. to run the obfuscated
.shuse thebashinterpreter (for examplebash out.shon Linux or macOS, or Bash from WSL/Git Bash on Windows).
- Clone the repository:
git clone https://github.com/s-r-e-e-r-a-j/CodeShade.git- Navigate to the CodeShade directory:
cd CodeShade- Make sure
Node.jsandnpmare installed for Bash obfuscation:
npm install -g bash-obfuscateInteractive Mode
Run CodeShade interactively:
python3 -m codeshade --interactiveYou can choose options like:
1) Python → base64
2) Python → emoji
3) Bash obfuscate
0) ExitWhen the tool asks for src: and dst:
-
src:= type the path to the original file you want to obfuscate (for examplehello.pyorscript.sh). -
dst:= type the path where the obfuscated file should be saved (for examplehello_b64.pyorout.sh). -
If you choose Python → Base64, after entering
src:anddst:, the tool will also ask forvar (payload):. This is the variable name that will store the Base64-encoded data in the obfuscated Python script. You can press Enter to use the default namepayload. -
If you choose
Bash obfuscate, after enteringsrc:anddst:the tool will askauto install? (y/N):. If you typeythe tool will try to installbash-obfuscateusingnpm(this may require Node.js/npm). press Enter or typento skip automatic installation.
python3 -m codeshade py-base64 src.py dst.py --var payload-
src.py— the original file you want to obfuscate (example:hello.py). -
dst.py— the file CodeShade will create (the obfuscated output, example:hello_b64.py). -
--var— (python to base64 only) the Python variable name used inside the wrapper. This variable stores the Base64‑encoded data in the obfuscated script. Default:payload.
python3 -m codeshade py-emoji src.py dst.py-
src.py— the original file you want to obfuscate (example:hello.py). -
dst.py— the file CodeShade will create (the obfuscated output, example:hello_emoji.py).
python3 -m codeshade bash-obf src.sh dst.sh --auto-install-
src.sh— the original file you want to obfuscate (example:script.sh). -
dst.sh— the file CodeShade will create (the obfuscated output, example:out.sh). -
--auto-install— ifbash-obfuscateis not found, the tool will runnpm install -g bash-obfuscateto install it automatically. This requires Node.js and npm to be installed
- You can execute the obfuscated script to run the original code.
- Python:
python3 <obfuscated>.py - Bash:
bash <obfuscated>.sh
- Python:
This project is licensed under the MIT License