Is there any ways to encrypt the save file?

Do you know any ways to encrypt save files?
Save file I mean when you have been made save/load system for your game and then when you play the game and save, it creates a save file in the game folder. Is there any software or some tricks in GDevelop that can be done?
Now you can open the save file using notepad, and edit the values as you wish.

Or is the only way to “encrypt” save file, name every values you want to save using some secret language that no one else can understand than you?:smiley:

Encryption is basically using a language only you understand :slight_smile:
//I simply made a function to store numeric data, its something like “5x-10” or so, nobody’s gonna solve that extremely difficult encoding

If the game itself is not encrypted, it shouldn’t be too hard to decrypt.
But why bother as long as other cheating tools. People who don’t bother to cheat won’t edit the file anyway.

That’s what I meant to do, but then I thought it might get too confusing to myself after a while :smiley:

Maybe they don’t, but if they do, it’s too easy to open and edit it.
It could be cool if it automatically make a simple encrypt somehow :smiley:

Ps. It’s great to see community is getting more active :stuck_out_tongue:

External event for decrypting stored data?

//im tryna be active but i dont really know much about js

I don’t know what do you mean about that. what help is it to decrypt stored data I already should know? :smiley: I mean when I am making save/load system, I have to make the “secret language” and it might get too confusing.
I’m talking about native game save files.

But yeah, it’s not a big deal if there is no solution about that, just wondering is it possible :stuck_out_tongue:

In theory you can write a piece of javascript code or c++ code to be used as an event. Call the event to encrypt the save string before save it as a file. You also need to write your own decrypt code to decode the string (should be easy with javascript because yon can just parse the string as json or even javascript code).

I haven’t tried c++ code though, maybe a dev knows better.

But maybe RazorSh4rk was right, if you just want to stop those over curious player, you can just scramble the values.

Yep that what I was thinking it might work using some code. If that is possible devs might add it to the GDevelop automatically “Encrypt the file yes/no?” like a thing.

For native games there is an extension named “AES encryption algorithm” to encript files with a specific password, just encrypt the save file after finish the save process, and decrypt it before reading :wink:

1 Like

Oooooh! That’s nice! I have to try it out! :laughing: Thanks!

Btw, you need two save files and you need to encrypt and decrypt both of them back to back so you don’t have one file that shows everything and one that shows encrypted version :stuck_out_tongue:

You can delete the extra file too…

  1. Decrypt User0.sav into file User0.sav.tmp
  2. Read everything from User0.sav.tmp
  3. Encrypt User0.sav.tmp to User0.sav
  4. Delete User0.sav.tmp

If you could force GD to make the file “User0.sav.tmp” (the decrypted one) exist in the process memory only, so a decrypted file never exists in the user file-system, the process would be perfect :neutral_face:

1 Like