ID:91637
 
Safe Save by Garthor
Protects savefiles from being tampered with
6 fans · Created Jan 13 2010
The purpose of this library is to use an md5() hash to secure a savefile from tampering,
in a manner which is not trivially circumvented.


This library defines three new procs:

safe_save(var/savefile/F, var/name)
Creates a new, protected savefile with the specified name from F.
Returns the newly-created, protected savefile.
The savefile F is left unmodified.

safe_load(var/savefile/F)
Creates a new savefile from the protected savefile F (created using safe_save()).
Returns the un-protected savefile, for reading.
The returned savefile can be read as normal, and is created as a temporary savefile.
Will return null if the savefile has been found to be tampered with.

make_hash(var/text)
Creates a hash from a text string. By default, will simply return md5("[world.hub_password][text]").
Should be overridden to use a more unique salt, if you do not feel that your hub password is secure.
Hey Garthor, I think you should check this out. This is causing some internal errors with BYOND. Lummox explained it but I really did not understand it.

http://www.byond.com/forum/?post=318642