Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Encrypting save files

Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 3rd Sep 2003 11:25
Having only just figured out how to create a save file all by myself with no tutorials, i am happy with myself HOWEVER!! how can i make it so that it cannot be opened and altered in wordpad/notepad??

Are you a tool? can I step through to find another plane or just the shadow of a man?
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 3rd Sep 2003 19:31 Edited at: 3rd Sep 2003 19:39
Firstly, congratulations on working out how to save!

I guess that depends on what your save file is. If you stick all your data to be saved into a large array (e.g. SaveArray(x,y)) then use the SAVE ARRAY command then the file that is produced isn't readable (I think, can't check at the minute) in notepad.

Alternatively, if you have simply outputed to text to a .txt file then before you save each variable you could alter it.

For example, you could simply square root each numerical value or raise it to the power 1/5 or something similar and then save that value. Or if it's a string that you want to save, you could convert each character in the string to it's ASCII value, add 1 (or another number) to it then save the resultant string to your .txt file.

Although this isn't encrypting as such, it means that when you perform the reverse upon loading, any weird values, etc can be recognised and you could code it so that your game engine would recognise that the file had been tampered with.

When I get home, i'll see if I can dig out my old XOR encryption algorithm I toyed with in VB.....

I hope this makes some sense.

Flashing Blade
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 4th Sep 2003 23:58
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 5th Sep 2003 19:34
Levanthus: i find that a simple enough decoy is to write to files in binary mode instead of text.

for what you're doing, look at the other file commands like WRITE FLOAT and WRITE WORD. you'd need a hex editor to hack these, and then you'd still have to know the order in which you save it.

i also use a checksum. i'm evil, so i put the checksum in the middle of the data so as to hide it and delete the file if it isn't right. i tell the user the file was corrupt and they can suck a fart.


-= i only do what my rice krispies tell me to do =-
Retired Moderator
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 02:11
Suck a fart? LOL

Login to post a reply

Server time is: 2024-03-01 03:42:28
Your offset time is: 2024-03-01 03:42:28