Loading repository data…
Loading repository data…
KnifeXRage / repository
Godot Secure is a Simple Python Script That modify the Godot Source Code Automatically, to integrate Camellia-256 / AES-256 encryption with a unique security token system. This solution creates a cryptographically unique engine build that prevents generic decryption tools from accessing your game assets.
Godot Secure is a Simple Python Script That modify the Godot Source Code Automatically, to integrate Camellia-256 / AES-256 encryption with a unique security token system. This solution creates a cryptographically unique engine build that prevents generic decryption tools from accessing your game assets.
This script enhances your Godot engine with Camellia/AES encryption and a unique security token system with just one command. Unlike standard encryption, this creates a custom Godot build that's cryptographically unique to you, preventing universal decryption tools from working with your game assets.
Standard Godot encryption has known vulnerabilities. Our solution:
| Feature | Standard Godot | Godot Secure |
|---|---|---|
| Encryption Algorithm | AES-256 | Camellia-256 / AES-256 |
| Universal Decryption Tools | Vulnerable | Protected |
| Per Engine-Build Uniqueness | No | Yes |
| Key Obfuscation | No | Yes |
| Magic Header | Fixed | Randomized |
| Required Reverse Engineering | Generic | Per-Build |
Directly Run The Script inside Godot Source and Build your
Engine and Templatesas usual with encryption Key!!
Must Read Godot's Official Documentation: 🔗View Official Documentation
git clone https://github.com/godotengine/godot.git
cd godot
# Generate 256-bit key (KEEP THIS SECURE!)
openssl rand -hex 32 > godot.gdkey
## Set environment variable
# For Linux/macOS:
export SCRIPT_AES256_ENCRYPTION_KEY=$(cat godot.gdkey)
# For Windows (PowerShell):
$env:SCRIPT_AES256_ENCRYPTION_KEY = Get-Content godot.gdkey
# Or Set it Permanently from Control Panel (Windows)
You Can the Script directly inside Godot Source folder without using arguments! Using:
python godot_secure.py
# Run The Godot Secure Script
python godot_secure.py /path/to/godot_source/
#Example:
python godot_secure.py godot/
# For Engine (Must REQUIRED):
scons platform=windows target=editor use_mingw=yes # Example for Windows
scons platform=linuxbsd target=editor use_mingw=yes # Example for Linux BSD
scons platform=macos target=editor use_mingw=yes # Example for MacOS
# For Export Templates (Must REQUIRED):
scons platform=windows target=template_debug use_mingw=yes
scons platform=windows target=template_release use_mingw=yes
...
Build others Templates like these too and use
platform=macosorplatform=linuxbsdto build for MacOS or Linux BSD, Also useuse_llvm=yesoruse_mingw=yesfor faster builds!
The script makes these key modifications:
Unique Identifiers
Key Protection
token_key.write[i] = key_ptr[i] ^ Security::TOKEN[i];
OR
Actual Key = (Input Key) XOR (Security Token)If Advanced Key Derivation Enabled
1. token_key.write[i] = (uint8_t)(((((key_ptr[i] & Security::TOKEN[i]) + key_ptr[i]) ^ 151) ^ key_ptr[i]));
2. token_key.write[i] = (uint8_t)(((((((((key_ptr[i] ^ Security::TOKEN[i]) + key_ptr[i]) ^ 106) + key_ptr[i]) ^ 138) << 6) | ((((((key_ptr[i] ^ Security::TOKEN[i]) + key_ptr[i]) ^ 106) + key_ptr[i]) ^ 138) >> 2)) | Security::TOKEN[i]));
3. token_key.write[i] = (uint8_t)(((((Security::TOKEN[i] & key_ptr[i]) + Security::TOKEN[i]) ^ Security::TOKEN[i]) ^ Security::TOKEN[i]));
4. token_key.write[i] = (uint8_t)((((((((((((key_ptr[i] << 7) | (key_ptr[i] >> 1)) ^ Security::TOKEN[i]) + key_ptr[i]) ^ 242) << 2) | ((((((key_ptr[i] << 7) | (key_ptr[i] >> 1)) ^ Security::TOKEN[i]) + key_ptr[i]) ^ 242) >> 6)) + Security::TOKEN[i]) ^ 126) << 6) | ((((((((((key_ptr[i] << 7) | (key_ptr[i] >> 1)) ^ Security::TOKEN[i]) + key_ptr[i]) ^ 242) << 2) | ((((((key_ptr[i] << 7) | (key_ptr[i] >> 1)) ^ Security::TOKEN[i]) + key_ptr[i]) ^ 242) >> 6)) + Security::TOKEN[i]) ^ 126) >> 2)));
MUCH HARDER to obtain using automated tools. And it will make your Engine build completely unique.File backups are created automatically, to restore them to their original version:
Run the restore_backup.py script located in utils folder.
Script not working?
python godot_secure.py /path/to/godot_sourceCompilation errors?
scons --cleangit submodule update --initGodot-Secure Script only once on Godot Source Code. Using script multiple times on same source code can cause Compilation Errors!. So, always refresh Your Godot source code before running the script on it.security_token.h exists in core/crypto/CamelliaContext / AESContext in modified files❗ Use at Your Own Risk
This script modifies core Godot engine files. Always:
🪧 Important Considerations
🔄 Always rebuild when:
Hi there! I'm a college student passionate about game development and programming. While this project will always remain free, your support would mean the world as I balance studies and financial challenges.
Every contribution helps maintain and improve this project. And encourage me to make more projects like this!
This is optional support. The tool remains free and open-source regardless.
Created with ❤️ for Godot Developers
For contributions, please open issues on GitHub