Protecting points in localStorage from editing

onlyketch

Member
Hello everyone! I use GMS 2 to create html5 games, at the moment I use ini files to save the best score in LocalStorage. But anyone can open the developer console in the browser and replace my values. How can I protect this data? Are there easy solutions?
 

TsukaYuriko

šŸŒ 
Forum Staff
Moderator
Absolutely? Not possible.

You can achieve relative protection by encrypting the data using an encryption algorithm. A simple XOR encryption will render the file unreadable to most of your players. If they can't read it, they won't really know what to modify and are more likely to break their save file than to achieve anything sensical by editing the file.

If this is just about scores, though, I doubt it's even worth it. There's no need to protect that.
 

duran can

Member
after encrypting your data, you should keep it in localstorage or cookie. If you encrypt "global.gold = 100" data as" qlkejq = smfndsm", hackers will get harder. There is no other way, sorry.
 
Top