+3 votes

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?

in Engine by (141 points)

1 Answer

+3 votes
Best answer

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

by (719 points)
selected by

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?

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

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

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

uhh, it give me this

'export' is not recognized as an internal or external command, operable program or batch file.
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.