Skip to content

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.

License

Notifications You must be signed in to change notification settings

s-r-e-e-r-a-j/CodeShade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

CodeShade

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.

Features

  • 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.

Compatibility

  • Obfuscation works on all systems.
  • Needs Python 3.10+.
  • To create obfuscated Bash files you need Node/npm. to run the obfuscated .sh use the bash interpreter (for example bash out.sh on Linux or macOS, or Bash from WSL/Git Bash on Windows).

Installation

  1. Clone the repository:
git clone https://github.com/s-r-e-e-r-a-j/CodeShade.git
  1. Navigate to the CodeShade directory:
cd CodeShade
  1. Make sure Node.js and npm are installed for Bash obfuscation:
npm install -g bash-obfuscate

Usage

Interactive Mode

Run CodeShade interactively:

python3 -m codeshade --interactive

You can choose options like:

1) Python → base64

2) Python → emoji

3) Bash obfuscate

0) Exit

When the tool asks for src: and dst:

  • src: = type the path to the original file you want to obfuscate (for example hello.py or script.sh).

  • dst: = type the path where the obfuscated file should be saved (for example hello_b64.py or out.sh).

  • If you choose Python → Base64, after entering src: and dst:, the tool will also ask for var (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 name payload.

  • If you choose Bash obfuscate, after entering src: and dst: the tool will ask auto install? (y/N):. If you type y the tool will try to install bash-obfuscate using npm (this may require Node.js/npm). press Enter or type n to skip automatic installation.

Command-Line Mode

Obfuscate Python to Base64:

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.

Obfuscate Python to Emoji:

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).

Obfuscate Bash script:

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 — if bash-obfuscate is not found, the tool will run npm install -g bash-obfuscate to install it automatically. This requires Node.js and npm to be installed

Note

  • You can execute the obfuscated script to run the original code.
    • Python: python3 <obfuscated>.py
    • Bash: bash <obfuscated>.sh

License

This project is licensed under the MIT License

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages