Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for the safest way to archive and store a GKScore that needs to be re-submitted to Game Center (say, because the user didn't have a network connection at the time the score was earned). I would like to archive the GKScore instance in case the app is terminated before it can be successfully re-submitted to Game Center.

My worry is that if it's archived to an instance of NSData and saved in a .plist, it would be easy to manipulate. Perhaps this worry is unjustified?

NOTE: I posted a similar question on Stack Overflow only to realize that it's better asked here.

share|improve this question

If you app is not hacked, user can only access the documents folder from iTunes. So, just save it as you do to the Library folder.

If user can't access the file, it will be no problem even if the data is archived as plain text.

share|improve this answer
thanks for the info about the documents vs. library folder. It is my understanding that users with jailbroken devices have access to all directories. It is these users that I worry about lowering the fidelity of the Game Center highscores list. – jonsibley Nov 8 '11 at 16:55
@JonathanSibley You shouldn't worry about the few jailbroken devices out there... the problem is that scores are apparently being sent unencrypted to the gamecenter servers so that somebody can sniff out the payload and change it. Here's a related question on SO. – bummzack Nov 11 '11 at 22:51

I don't think there is any way around this because the real weak link is the connection to Game Center. I faced that same problem as you have, so I encrypted all data saved to the device while it waited to be uploaded, yet, 1 day after my App was released, the high score tables were filled with bogus scores. Obviously the data has to be un-encrypted before it's sent and my theory is that the information is intercepted at this point and altered, or people are just connecting to Game Center directly via computers and uploading whatever they want. Does anyone know what safeguards Apple does for this?

Even big name games like Angry Birds have this problem. I have yet to see any game that doesn't have it's high score tables filled with junk. I think that's one of the reasons that the "friends high scores" is more important to a lot of people. If your friend hacks the high score tables to beat your score you can just punch him.

If anyone has a fool-proof way to securely store and upload game center scores, I'd love to know it as well, although I don't think it's possible.

share|improve this answer
You're right. As of now, scores are being sent unencrypted to the apple servers. – bummzack Nov 11 '11 at 22:46
I'm not sure on how the leader boards are implemented, but perhaps you could encrypt their score in a bunch of bogus score values that are uploaded, and when downloaded back to (presumably) view in your leader boards table, you could decrypt them? Should stop packet hijacking and would make editing the encrypted local file quite difficult also. – dcousens Nov 12 '11 at 2:17
@Daniel then you should implement your own leaderboards on a separate server. The GameCenter interface (which will also display your leaderboard) doesn't know anything about your obfuscation and would thefore display the "bogus" scores. – bummzack Nov 12 '11 at 10:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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