I have a small game that I would like to keep track og global hiscores for. The basic is simple: username and score is submitted to a server for storage and later polling. However how do I ensure that these scores aren't faked?

Obviously, just accepting a submitted user+score blindly will allow people to telnet in their desired score. To combat this, I've thought up two approaches:

  • Checksumming - In addition to the score and the username, the application sends a checksum of the two using an obscure algorithm and salt. If the same checksum doesn't add up, the server will reject it. However, how easy is it to reverse engineer the checksumming used, considering that this is an android application?

  • Submitting the entire game - In addition to user+score, the steps taken to reach the score is also sent. The server then emulates the game to see if the steps result in the same score, and if not, rejects it. I consider this to be the safest, but for some types of games this can be very hard to do, as the factors are far too many.

Is there a middle road? Are there any other methods worth considering? It's not like this is vital to national security or anything, but I would prefer if the users aren't left with "HackedYourGame: 999999999 points" on top of the list.

  • 3
    One of the rules of security management is that you cannot trust the client unless you physically control it. Anything that you can think to do in the client can be falisifed. And if you over-engineer it, you will just end worsening the game experience for all the user ("why does this game use so much of my monthly bandwith/battery?") So don't overthink it, do some checksumming/encryptation to deter lazy cheaters, and relax.
    – SJuan76
    Commented Jul 13, 2014 at 16:50
  • @SJuan76 I was thinking the same thing. Besides, after a while the list of hiscores will be harder and harder to beat, so the amount of potential entries should decrease over time. It will then be easy to manually QC the entries.
    – Jarmund
    Commented Jul 13, 2014 at 17:00
  • you can submit the replay with the highscore and let the server run them to verify, that would also allow other players to learn from each other, that would require a replay ability in the game Commented Jul 13, 2014 at 17:02
  • 1
    @Philipp indeed: gamedev.stackexchange.com/questions/4181/… Commented Jul 13, 2014 at 18:25
  • 1
    You could submit only parts of the entire game (maybe not enough for a full replay, but enough to check the score is plausible).
    – Doc Brown
    Commented Jul 13, 2014 at 18:40

1 Answer 1


First remember that everything can be cracked given enough access. You can only make it expensive.

You can make sure the on-wire protocol cannot be hacked. You can encrypt it with a one-time password (from the server) so that mere wire snooping will see only gibberish, that changes every time. And you can include installation or user-specific data so a simple replay won't work. You can also include game-specific stats (other than the high score), just for interest and to raise the bar further.

Once you've reached the point where only the disassemblers and reverse engineers can make any progress, you're down to the real hard core. You can still make life hard by distributing parts of your algorithms in time (while the game progresses) and space (bits of code all over the place).

But bear in mind that what seems to be an impossible high score could actually be a bug or cheat in your software. No point guarding the protocol if the game itself can be hacked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.