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.

Program Announcements / Super secure, tamper-proof data storage functions!!!

Author
Message
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Nov 2006 20:50
These functions are specifically designed for storing information which the player cannot change to make them better at something in game.

eg.
If you made a gambling game, and needed to store each players money, when using write integer, anybody can open your file in a hex editor, and change that to a much higher value. When using these functions, this is almost impossible.

It works by storing two lots of your file, seemingly randomly mixed together. You must specify a numeric code (in a string) for the password. (Letters are not secure), and also an Xbyte value. The Xbyte value needs to be kept most secret, but although there are only 256 options, it is impossible to guess, unless you have the password as well.

The Xbyte is added on to every byte in the second copy of the data, and is to stop people pairing up the two file by using the byte values.

As most media types can be easily converted to a memblock in program, that is what the program reads.

If anybody attempts to tamper with the saved file, or the password/Xbyte is incorrect, then the Sec_Read_Memblock function will return 1

If in your save file, you only need to save a few bytes, it is good to pad it out with some extra useless bytes to make it more secure.

To securely store a memblock in a file, use Sec_Store_Memblock
To securely read a file to a memblock, use Sec_Read_Memblock

fsize is the size of the memblock to be created (if one does not exist with the specified number) and must be the size of the data, or an error will occur.

I hope somebody finds it useful

Here is the code:


Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Nov 2006 13:26
50 views and not a single post!

Kenjar
18
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 27th Nov 2006 13:40
I know, annoying isn't it?

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 27th Nov 2006 14:00
Not to piddle on your bonfire here, but you could achieve a similar effect just by wrapping/recreating an MD5 hasher.

Store your score with its hash somewhere, and if the hash of the score doesn't match the hash, something's wrong.

Now, before you all reply suggesting a simple work around, the key to success here is to salt your hash with something ... a secret. That secret can be anything, provided it's consistent. It can be a magic word, the size of the data you're hashing, the MAC address of the computer... whatever.


I'm superfly TNT
Kenjar
18
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 27th Nov 2006 18:53
I'd get used to people not caring much, and don't take it personally. The vast majority of people will download, use, and never give the author a second thought. A few will complain that it's not done in a way they like. If you get one "it's great post!" or two, then this is an outstanding innovation from the community. Best thing to do is carry on reguardless, and not worry about it.

Remember you've put hours of work into this thing! All the community sees is the end result, they havn't put as much of themselves into it.
With the number of annoucements on here, the thrill of seeing someone make a post here died many, many years ago.

Still, congrats on the functions, I'm sure one or two of the 50 viewers will be using them as some point. Keep up the good work.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Nov 2006 19:00
Quote: "
Remember you've put hours of work into this thing!
"


Actually, it was only a few minutes!!!

Thanks anyway

Airslide
19
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 28th Nov 2006 00:57
I'll try it out later - I've got homework - from what it sounds like though it could be useful.

Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 29th Nov 2006 22:13
There cant be enough of cool and free code snippets out there and if you don't get a 'wow thats cool' type messages then it means everyone is already trying it out and are very satisfied - without free codes and plugins our community will die! Thanks,

AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c, DBP 6.2
http://www.myspace.com/producerolby

Login to post a reply

Server time is: 2024-05-26 16:53:54
Your offset time is: 2024-05-26 16:53:54