GDScript Encryption in 3.X?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FlyingFlower

I’m trying to add GDScript encryption to reduce the chances of people changing lines in my script.

I see that the Godot native looks for a SCRIPT_AES256_ENCRYPTION_KEY env variable and sets a script encryption key based on that in the binary. It’s being used to read “.gde” files (encrypted gdscript). You can go here for more details:

Apparently, Godot 2.0 had an option to export .gd files as .gde, but I don’t see that anywhere in Godot 3.0 nor 3.1. How can I make a .gde file?

:bust_in_silhouette: Reply From: GameVisitor

This feature seems to be back in 3.1 (at least in graphically in the IDE, didn’t actually test it).

Yep, I’m the one who ported it in 3.1, works fine so far :slight_smile:

Xrayez | 2019-04-13 11:50

:bust_in_silhouette: Reply From: Xrayez

Script encryption feature got merged in 3.1 (nobody requested porting it in 3.0 though).

I’ve also written documentation on how to compile an engine with script encryption key.

Also note that it’s possible to export scripts as plain text, which can be useful for debugging purposes, or when used with unit testing.