+1 vote

So apparently I never knew that the GDScript could be compiled into .gdc files.

I am just curious since we can ship our game with a zip, we could also just send out the appropiate files "gamemanager.gdc" for easy patching.

My question is, would it be okay to do this? How easy could it be for someone to read the gdc file to get the source? I mean, if it would require advance knowledge, and not just a "script kiddy" could do it.. I mean, I think it's fine and I'm excited! But if it's something where a script kiddy could just get in < 2 minutes.. I'll be hesitant! :P

Thanks in advance!

in Engine by (301 points)

3 Answers

+2 votes
Best answer

you can export encrypted script, .gde not .gdc
it's in Export > Script tab.

but in order to do this work properly,
you need to make encrypted template.

https://asecuritysite.com/encryption/keygen
get aes256 key here. (try with aes-256-cfb)

and compile template like this.

export SCRIPT_AES256_ENCRYPTION_KEY=BF25A52AECCAA8DEC8AFEEB131B2C2064B1AE8D2C395C7BF150C71229B009394
scons -j 4 platform=x11 target=release

and then, use same key in Export > Script.

now you get encrypted script game.

(IIRC, there was document about this, but I could not find now)

by (9,662 points)
selected by

Hey all,

Is this still valid for 3.x ? I can't seem to find the "script" tab in export anymore, and the info mentioned here (i guess from : https://github.com/ScyDev/godot/wiki/Export-Encrypt-Scripts seems old...)

Thx in advance :-)

I can't find it either for 3.x
I'm not sure it's forgotten feature or removed...

So how can we point it to the developers, to see if it is missing ?

On a side note, (probably not proper script encryption) but when manually checking the binary in a text / Hex editor, in 2.x, I was able to see the strings of my code, whereas here (in 3.x) I am unable to find them.

Again, this is not proper encryption i think, but might a small default security layer... ?

I'm not expert on this.
you can open an issue for it and discuss with expert on it.
https://github.com/godotengine/godot/issues

Another way to generate key offline (linux):
openssl enc -aes-256-cbc -k secret -P -md sha1 > godot.gdkey

+2 votes

The normal behaviour of 2.x is to compile scripts (export a zip package and look inside), you need to refer to gdc files instead of gd when loading resource packs too.

Is also possible to export a zip, extract the gdc and attach it to a node in another project (just do not try to edit it).

by (7,832 points)

Both great answers.. I accepted the other one for now though, appreciate it!! I'm thinking of doing the option you listed

0 votes

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

by (846 points)
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.