Repository: godot
Issue: Cross-compiled export templates cannot encrypt files correctly
Labels: bug,platform:windows,topic:buildsystem,needs testing,topic:export

### Godot version

4.1.2-stable

### System information

Windows 11 & Ubuntu Focal

### Issue description

I'm using an `ubuntu` docker image to automate the build process for my game. This means I am compiling windows export templates from ubuntu. This works perfectly for the most part, but I ran into issues when attempting to encrypt files - specifically, the exported version of the project will freeze, crash, or simply not load scenes/resources correctly (depending on which files are included). Logs look something like this:

```
Godot Engine v4.1.2.stable.custom_build.399c9dc39 - https://godotengine.org
Vulkan API 1.3.242 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3060 Laptop GPU
 
USER ERROR: The MD5 sum of the decrypted file does not match the expected value. It could be that the file is corrupt, or that the provided decryption key is invalid.
   at: open_and_parse (core/io/file_access_encrypted.cpp:94)
USER ERROR: Can't open encrypted pack-referenced file 'C:/godot-projects/encryption-test/exports/cross-compiled/Encryption Test.pck'.
   at: FileAccessPack (core/io/file_access_pack.cpp:394)
USER ERROR: The MD5 sum of the decrypted file does not match the expected value. It could be that the file is corrupt, or that the provided decryption key is invalid.
   at: open_and_parse (core/io/file_access_encrypted.cpp:94)
USER ERROR: Can't open encrypted pack-referenced file 'C:/godot-projects/encryption-test/exports/cross-compiled/Encryption Test.pck'.
   at: FileAccessPack (core/io/file_access_pack.cpp:394)
USER ERROR: Condition "r != len" is true. Returning: ERR_CANT_OPEN
   at: load_source_code (modules/gdscript/gdscript.cpp:1039)
USER ERROR: Failed loading resource: res://splash.gd. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:273)
USER ERROR: res://splash.tscn:12 - Parse Error: [ext_resource] referenced non-existent resource at: res://splash.gd
   at: _parse_ext_resource (scene/resources/resource_format_text.cpp:162)
```

This only happens when attempting to actually encrypt files (i.e. including something like `*.gd` in the "Filters to include files/folders" section of the export setting). It works fine when _just_ the "encrypt index" option is turned on. This also only happens if the export template is cross-compiled. When compiling templates from windows, everything works as expected.

### Steps to reproduce

The minimal reproduction project has "cross-compiled" and "native windows" templates included. It also includes exported versions of the project to demonstrate the issue, and a `Dockerfile` which can be used to compile the export template from ubuntu.

The `windows` version of the exported project works as expected, while the `cross-compiled` version freezes.

The `README.md` file contains detailed steps on how to reproduce the issue, how the export templates were generated, how to use the docker image, etc.

### Minimal reproduction project

Since the file is too big to upload directly, here's a link to the `.zip` file on Google drive:
https://drive.google.com/file/d/1sI-9p7WYtePu7wAfzk36IMNF7GdcErWL/view?usp=sharing