Support saving with encryption enabled #1851
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows for developers to opt-into saving their data with a layer of encryption. In order to opt-in, they have to go to the settings, navigate to the
Saving
section and add a password to theEncryption Password
field.When setting a password, it is highly likely that existing saves made for testing become invalid and cause errors to pop up. To get rid of the errors, they can remove the files and let it set up new ones. But i would recommend to ignore setting an encryption password until exporting the game in order to make debugging easier.
Along the way i did come across some security concern when it comes to arbitrary code execution when loading variables from a file. It is possible to inject code into a save file and have it run on the end user's computer.godotengine/godot#80562
It should be noted that by making use of encryption, it becomes a fair bit harder to create a code injection, as long as the password does not get known to the attacker.
So for now I would personally recommend developers making use of an encryption password when releasing their game.