Save data to disk safely

  • Hi, what is the safest way to save a game data file on disk with NWjs ?.

    I need to avoid that the user can identify the data and edit them in his favor.

  • Why ?

  • It's simple, because the user could unlock levels and other things.

    I mean to write the file on the hard drive.

  • Yeah but why do you want to stop them from doing that? Once they buy the game, shouldn't they be able to do whatever they want with it ? If they want to skip the grind so much or play with their favorite items or replay their favorite level why not let them ?

    To answer your question you could try and scramble the save data and make it an unreadable gibberish by like converting it into a string and then base 64 and then shift the characters a little and then convert to string and then shift the characters again and then your code would need to do all of those operations every time it tries to save and load the game I guess

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well that's your philosophy but it's not mine, it's also an online game and the idea is to encourage the game to unlock the elements.

    Thanks for the info.

  • You can use CB Hash or similar plugin to digitally "sign" your save data. Save it together with the hash, on load check if the hash is correct.

    This will make the simple editing of the save file impossible, but won't protect from a more experienced hacker.

  • You can use CB Hash or similar plugin to digitally "sign" your save data. Save it together with the hash, on load check if the hash is correct.

    This will make the simple editing of the save file impossible, but won't protect from a more experienced hacker.

    Thanks, I think that should help me.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)