Right now a big issue with Godot as an engine is that it's easy to decompile someone's released game back into an editable state usnig tools like GDRE. This video about someone's game being stolen and sold on the app store started me down this rabbit hole.
This pull request obfuscated the key in the binary, so the hacker has to do some more work than just Ctrl+F this string to find your encryption key. There's now no identifiable strings in the relevant decryption functions, and the stored key is ciphered in the binary.
As an example, it converts your AES Key from being 'plain hex' identifiable in your binary of:
While it doesn't necessarily 'secure' Godot my proposal makes it much more difficult to find the encryption key. Currently you can very easily find AES Keys within an encrypted exe. Obfuscation is beatable, but it's better than the current implementation in my opinion, and I am looking to start a discussion on best practice to prevent decryption.
It does get set to memory, but we could potentially unset the variable once the file is loaded, I'm not sure the best way to go about this but I'm hoping we as a community can figure it out.
I spoke with the hacker on their process and it had nothing to do with my server's security (I am using Steam's leaderboards).
They used Godot's --script command line argument to inject a custom `hack.gd` overriding my game's core functions and features (unlocking the unavailable DLC to play private lobbies, lowering their time, and increasing the Engine's physics tick rate to go faster).
They were able to write the script since they new exactly how my code worked by decopiling the game using GDRE once they got the AES key from the binary.
I modified my own Godot build to now ignore any `--script` overrides, but the vector to get my new rotated AES key remained, so I began work on this.
I had them check to see if they could pull the key from my new binary and after over an hour of trying they couldn't find it, so I figured I'd submit this to the engine as a PR and try to help others.
Right now a big issue with Godot as an engine is that it's easy to decompile someone's released game back into an editable state usnig tools like GDRE. This video about someone's game being stolen and sold on the app store started me down this rabbit hole.
Then, someone informed me how trivial it was to fetch your AES Encryption key (timestamped).
This pull request obfuscated the key in the binary, so the hacker has to do some more work than just Ctrl+F this string to find your encryption key. There's now no identifiable strings in the relevant decryption functions, and the stored key is ciphered in the binary.
As an example, it converts your AES Key from being 'plain hex' identifiable in your binary of:
`aa806faf0a80b29b1893d351da03a61facd2181a7522a991b426050aa7534951`
to
`4FB218976ACD23EF093CABD41F72E560885EC39137AE4A0DF039127BD7668C20`
Hope this makes sense!
While it doesn't necessarily 'secure' Godot my proposal makes it much more difficult to find the encryption key. Currently you can very easily find AES Keys within an encrypted exe. Obfuscation is beatable, but it's better than the current implementation in my opinion, and I am looking to start a discussion on best practice to prevent decryption.
Congratulations Seahorse! Glad to be one of those 20 copies ;)
Still meaning to leave you a steam review but I keep rage quitting Paralyzed before I spend the time to do so.
Potentially, which is why I want to start a discussion around this topic.
I also created a reproduction project with this method to let people see if they can find / dump the provided key: https://github.com/bearlikelion/godotxor
It does get set to memory, but we could potentially unset the variable once the file is loaded, I'm not sure the best way to go about this but I'm hoping we as a community can figure it out.
I spoke with the hacker on their process and it had nothing to do with my server's security (I am using Steam's leaderboards).
They used Godot's --script command line argument to inject a custom `hack.gd` overriding my game's core functions and features (unlocking the unavailable DLC to play private lobbies, lowering their time, and increasing the Engine's physics tick rate to go faster).
They were able to write the script since they new exactly how my code worked by decopiling the game using GDRE once they got the AES key from the binary.
I modified my own Godot build to now ignore any `--script` overrides, but the vector to get my new rotated AES key remained, so I began work on this.
I had them check to see if they could pull the key from my new binary and after over an hour of trying they couldn't find it, so I figured I'd submit this to the engine as a PR and try to help others.