C
C#11mo ago
prinzbartu

Encoding my game data files (Unity)

So I already made a GameData script with all my data being loaded and saved on a json file. But I want to encrypt them in a way, that is not easily changeable for everyone else. It doesnt have to be the best system, it should just not look like {Value: x} this is my code for my gamedata: https://pastebin.com/yUZ2zzXc Know that im completely new to encoding, so I have no clue what to do and how :)
Pastebin
GameData Script - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
2 Replies
Pobiega
Pobiega11mo ago
the "basic" is to just base64 encode/decode your json, thats very common for web games. Its easily reversable, as base64 tends to be fairly recognizable. so someone who really wants to edit the file will be able to do so. If you want something harder to crack, you can roll your own encoder
canton7
canton711mo ago
The standard ways to do this are to encrypt your save file (which will stop people being able to read it), or sign it (which lets people read it, but they can't change it). In both cases you'll have to store the key in your application, where it will be possible to extract, but that will need a bit more effort
Want results from more Discord servers?
Add your server