How does the Script Export Mode work?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By user41420082
:warning: Old Version Published before Godot 3 was released.

I choose Text, Compiled, and Encrypted and nothing changes. My scripts inside the data.zip file continue to look the same, like it’s compiled or a binary file.

is this feature not implemented?

:bust_in_silhouette: Reply From: Freeman

You need your own compiled version of the engine to be able to encrypt scripts, so Godot version available for download from Godot webpage will not work.

You need to generate the key first. You may do that for example on this page
https://www.grc.com/passwords.htm that generates passwords. This password is called encryption ‘key’ in Godot.
New and random key is generated simply when you enter the page, so it’s already waiting there or you.
That webpage generates 3 password strings for you. You should use the first ‘64 random hexadecimal characters (0-9 and A-F)’. It will look very similar to (but don’t use this one, generate your own):

56B14B51048E4F142B138F378CFD774ADB657AC53F3D41C2A7AC908771595B76

So, lets pretend the above is your new key. Now you have to compile godot with the knowledge of the key. You do that by exporting the key with command:

export SCRIPT_AES256_ENCRYPTION_KEY="56B14B51048E4F142B138F378CFD774ADB657AC53F3D41C2A7AC908771595B76"

Then you normally compile the engine and templates.
In Godot you have to choose ‘Encrypted’ as a Script Export Mode and put the key into Project Export Settings > Script Encryption Key (256-bits as hex).
That’s it.
From now on your scripts will be encrypted.
Of course, like with all keys, it good not too loose them, so keep your key save. :wink:

Thanks a lot for the detailed instructions! Do I need to have access to all platforms (Windows, Linux, macOS) to be able to compile encryption-enabled export templates for them? Or only on the platform I’m using which is Windows?

user41420082 | 2016-10-08 02:03

Should work on all platforms.
I tested on Linux and Android and there was no problem with encryption.

Freeman | 2016-10-08 05:01

Okay thanks! I’ll give it a try when I get the time

user41420082 | 2016-10-08 20:24

What will happen when you try to do this without compiling the engine yourself?

Barina | 2017-12-17 21:09

uhh, it give me this

'export' is not recognized as an internal or external command, operable program or batch file.

ruruarchy | 2019-08-12 14:30