How hackable is my highscore?

Started by
24 comments, last by Enselic 18 years, 11 months ago
Uh, oh.

Feels like if I want this highscore to be secure, I need to work pretty hard :).
And the Obfuscator thingy seems to cost me a bit too "Our obfuscator is available at $799 for 1-5 developers."
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
Advertisement
Quote:Original post by Enselic
Uh, oh.

Feels like if I want this highscore to be secure, I need to work pretty hard :).
And the Obfuscator thingy seems to cost me a bit too "Our obfuscator is available at $799 for 1-5 developers."


well, not sure about that but shouldnt you already have one? my copy of Visual Studio 2003 came with Dotfuscator...


T2k
You could ask Benryves, IIRC he has/had an upload-your-score system on his site.
I'm using SharpDevelop which doesn't (yet) have an obfuscator. But if VS.NET have one, I guess I could find one for free somewhere.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
Quote:Feels like if I want this highscore to be secure, I need to work pretty hard :)


The only way that actually works is to support record/replay of the game, and upload the replay file to the server. The server replays the game, and enters the score that it arrives at.

Any scheme that depends on trickery on the client can be hacked -- and will, if it's important enough to somebody.
enum Bool { True, False, FileNotFound };
I actually though of that replay solution, but I was afraid it would use too much bandwidth. I'm using a low-price webhost with limited bandwitdth.

When I decided to do an online highscore game, I tried to come up with a game concept that you easaliy could create small replays-files to. But I ended up remaking an old DirectX game I made in C++ a long time ago and using a very simple form of highscore.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
Quote:Original post by hplus0603
The only way that actually works is to support record/replay of the game, and upload the replay file to the server. The server replays the game, and enters the score that it arrives at.


Then create a "perfect" replay file and send it to the server.


Quote:
Any scheme that depends on trickery on the client can be hacked -- and will, if it's important enough to somebody.


So make the scheme hard enough that noone really wants it to hack.


For the highscore system you can come around with signing the highscore.

More info here:
http://williamstallings.com/Extras/Security-Notes/lectures/authent.html

http://libtomcrypt.org/features.html
Quote:Original post by hplus0603
Then create a "perfect" replay file and send it to the server.

If your game is somewhat complex, I guess the easiest way to make a perfect replay-file is to play the game. I imagine a replayfile where you have a LOT of coordinates for instance. Editing these maybe tens of thousands of coordinates isn't really worth it. If you want more security, you can also let the game send the replay-file to a human, which then would analyze it so it looks "natural". If you want to submit a highscore to the old classic Elasto Mania, the replay is first analayzed by humans.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
What if you hack and slow down the game speed by factor ten ?
The replay method would probably be the safest. You at least get the guarantee that what they did to get the score is at least possible. Plus having replays of all the best players would be a cool feature. Still doesn't stop them from hacking it to always use the same seed to make it easier, or slowing it down to give them more time to react to things.

For storing the replay, you store the game's seed used by the RNG, and then record key presses/actions/events as a frame offset since the last event, and a special 'null' event that does nothing to prevent the offset counter from overflowing, which would screw things up.

Assuming 1 byte per offset (game logic could run at, say, 30 fps) there will be at least 2 bytes (offset + null event) every 8.5 seconds. Assuming the null event is 0xff, and the offset is 0xff, having a long run of 0xffff will be easilly compressed. Next, assuming an average of 8 key presses per second, a recording of a 20 minute game should total about 19KB. Again, it should be less with compression.

I'm not sure how authentication would help. It just ensures it coming from who we think it is and that it got there okay. It's not going to stop them from sending fudged data.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.

This topic is closed to new replies.

Advertisement