ID:271826
 
I'm not sure where this should go really, so I'm putting it here.

Basically, I was wondering if the following method is a good way of making sure savefiles are not edited, and if not then what is a good way?

My method is relatively simple. Whenever the file is saved a secondary file containing a single md5 hash is also saved. (If either of these files are missing the savefile cannot be loaded) That md5 is basically the entire savefiles text, obtained by using savefile.ExportText(). But, to make things somewhat more secure extra "garbage" is added to the beginning and end of the text each time it is checked.
For example, I would save the md5 hash by going.
var/fsave=F.ExportTopic("/")
P["enc"] << md5("dsadsadcxsi2s2_Sf[fsave]_dd3j89vhg43jf20")
And then that same useless text added before/after [fsave] would be added when comparing the loaded files (so provided the savefiles are unedited the hashes from the save file and what is checked upon loading will always be the same). Obviously I don't tell anyone what the text before and after [fsave] is, so unless they guess it they will have difficulty editing the savefile then generating a new hash to make the file seem valid (or that is the theory at least).

Anyway. I don't think you can technically call it encryption, but would it work to protect a savefile from being edited or not? And if not then what would be a better method?
Edited: yes
Hacked: no