Search code examples
iosnsuserdefaultsjailbreakgame-center

How to keep scores from being changed by jail breakers


OK . . .

I made a game where I use NSUserDefaults to store high scores. After placing it on the market, I had a friend show me how he could hack into it and just change high scores-- something I did not know was possible. With v2.0, I am adding GameCenter, so this becomes a much bigger deal as I post these scores to a leader board. I do not want jail breakers to be able to just change their high scores and have a bunch of trillions on the high score list. Is there a way to keep high scores saved on the device so that jail breakers can't edit them so easily? I really liked the simplicity of NSUserDefaults, so I was wondering if there was a way to make these un-see-able to jail breakers, but another save system would be just great. I save high scores for each individual level on the device and upload total episode scores to Game Center, so I can't just retrieve scores from their servers.

Any help would be appreciated. Thanks!


Solution

  • If the information is that important, you could always try hashing the values or storing them in a local database. CoreData sounds right up your alley for this. NSUserDefaults is great for storing values you might need easily, but is by no means secure. I'm sorry to say, but you will probably have a little bit of work to do if you want to make your app more secure.

    A few options to consider and research:

    • SQLite
    • CoreData
    • iCloud storage
    • Local File encryption - store values in local .plist and encrypt/decrypt as needed

    You have some work to do for sure. Hope this helps you on your way. Good luck.