Summary:
Godot 4 has encrypted PCK feature to protect game assets
Godot 3 has script encryption, though I’ve never seen it in action…
References:
Solution:
Here’s a snippet that adds --pck-key
argument to pass PCK encryption key
Insert it to https://github.com/godotengine/godot/blob/4.4.1-stable/main/main.cpp#L1656
} else if (arg == "--pck-key") {
if (N) {
String key_hex = N->get();
N = N->next();
if (key_hex.length() != 64) {
OS::get_singleton()->print("Invalid PCK key: must be 64 hex characters (256-bit), aborting.\n");
goto error;
}
for (int i = 0; i < 32; ++i) {
unsigned long byte_val = strtoul(key_hex.substr(i * 2, 2).utf8().get_data(), nullptr, 16);
if (byte_val > 255) {
OS::get_singleton()->print("Invalid hex digit in PCK key, aborting.\n");
goto error;
}
script_encryption_key[i] = static_cast<uint8_t>(byte_val);
}
} else {
OS::get_singleton()->print("Missing value for --pck-key, aborting.\n");
goto error;
}
Samples:
- (!NSFW) Vesper - Lust & Hunger
- Godot Engine v4.1.2
- Key:
524B982B805C74C0C015AD344111CA01FE96C45C892938DEBE3CAF0369981549
- (!NSFW) Life with the tribe
- Godot Engine v4.2.1
- Key:
545CE6F51402E8DD937CB6A12B8750DBF10CEFA24B9E67841F7088EEAAA74043
- (!NSFW) Five Nights at FuzzBoob’s
- Godot Engine v4.2.2
- Key:
99A4ECDC0D906B61F3BD0379B3E6490C0FF2B09EBF91F4F7D92918DCE973A900
- MikuRPG Demo
- Godot Engine v4.4
- Key:
2C050C70F4839D1A832A60A1484E38334CF2A77DA7BF1711D0534D449FBF1924
Tests:
Vesper - Lust & Hunger
, Life with the tribe
and Five Nights at FuzzBoob's
were tested on 4.2.2-stable
MikuRPG Demo
was tested on 4.4-stable
Without key | With key |
 |  |