godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Make it easier to encrypt PCK files #9340

Open DDAN-17 opened 7 months ago

DDAN-17 commented 7 months ago

Describe the project you are working on

A game

Describe the problem or limitation you are having in your project

I need to encrypt my PCK file, but I can't build the export templates to do so.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Create something to automatically encrypt the PCK files

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The entire encryption tab can be removed and instead, there can just be a switch to encrypt the PCK right on the first page.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, It cannot.

Is there a reason why this should be core and not an add-on in the asset library?

This is all about ease of use, and that would ruin the point.

AThousandShips commented 7 months ago

IMO the main tab of the export dialog is cluttered as it is, adding all the details of the encryption to it as well wouldn't help, I don't see how having to go to a separate tab is a major issue

I need to encrypt my PCK file, but I can't build the export templates to do so.

What do you mean? How is this related to removing the tab? You have to build the template in order to encrypt, that's not optional

timothyqiu commented 7 months ago

Encrypted PCK is like a locked box. You have to somehow send the key along with the box so that end users can open it.

Building your own export template is required because it hides the key within the executable, making it harder to crack. Any approach without building the export template is like duct-taping the key to the locked box. It defeats the purpose of encryption.

bruvzg commented 7 months ago

The entire encryption tab can be removed and instead, there can just be a switch to encrypt the PCK right on the first page.

Ability to configure which part to encrypt is important. Decryption is quite slow, in general you should encrypt as little as possible, only small files like scripts and scene file, and skip all big files like models and texture (encrypting these are 100% pointless).

AdriaandeJongh commented 7 months ago

skip all big files like models and texture (encrypting these are 100% pointless).

Unless, of course, you don't want users to access / steal these assets.

Calinou commented 7 months ago

Unless, of course, you don't want users to access / steal these assets.

Graphics API tracing software like RenderDoc or apitrace can be used to extract models and textures from any game, as long as it's not being streamed (cloud gaming). The graphics card has access to the unencrypted models/textures in this case, even if the PCK file has everything encrypted inside.

DDAN-17 commented 6 months ago

What do you mean? How is this related to removing the tab? You have to build the template in order to encrypt, that's not optional

Well then can there at least be some more documentation on where the template source is, and how to build it?

Calinou commented 6 months ago

Well then can there at least be some more documentation on where the template source is, and how to build it?

It's all here: https://docs.godotengine.org/en/stable/contributing/development/compiling/index.html

You'll want to read https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_with_script_encryption_key.html too.

DDAN-17 commented 6 months ago

Thanks!