1
\$\begingroup\$

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.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$
    – codeperson
    Commented Nov 8, 2011 at 16:55
  • \$\begingroup\$ @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. \$\endgroup\$
    – bummzack
    Commented Nov 11, 2011 at 22:51
1
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ You're right. As of now, scores are being sent unencrypted to the apple servers. \$\endgroup\$
    – bummzack
    Commented Nov 11, 2011 at 22:46
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Nov 12, 2011 at 2:17
  • \$\begingroup\$ @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. \$\endgroup\$
    – bummzack
    Commented Nov 12, 2011 at 10:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .