User Tag List

Results 1 to 9 of 9

Thread: Protecting Leaderboard scores

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    320
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Protecting Leaderboard scores

    So, how one protect the leaderboard from hacking?
    I've searched around and seems like there is no encryption available. I don't care much about hacking items but Leaderboards may discourage other users from trying the scores,..

    any ideas/suggestions?

  2. #2
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Unless you at some point store the scores into a file on disk (before submitting to GameCenter) it is quite difficult to hack the leaderboards score as it would involve live-editing the memory of your app.
    I don't know much about the internal security systems built into GameCenter but I don't think it is that straight forward to intercept and manipulate the leaderboard score as it is probably encrypted.

    If you do store the scores locally it is much easier to hack and also a bit difficult to prevent.
    A typically used way in cryptography to ensure data integrity is to create some sort of hash-value based on the data you wish to protect and a secret key.
    The secret key can still be found within your program by experienced people but you have reduced the amount of people who can hack your app to a fragment of what it was before.

    When you update the score in the file on disk you also update the hash value (called a HMAC).
    When you load the score from disk you check that the stored HMAC value is identical to one you create just after loading. If they aren't equal then the score was manipulated.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    320
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I see.. but this would work for scores for the current play. Let's say a good player can make 3000 points in a round, but with many plays, it reaches 300k points.. to make up to 300k points the game would need to save it to the disk, right?
    Is there any example for hashing scores with iOS?

    thanks

  4. #4
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    That makes sense yes. You need to store it somewhere if you wish the user to build uppon the previous score as he/she plays.

    I don't think there are any special hashing functions available in the iOS runtime at the current time you you can always make your own kind of checksum-like value. It might not be as secure but it is at lease very obscure.
    Again, "security through obscurity" is not a good security practice but it will reduce the amount of people who want to bother try to cheat in your game. When the user actually have the app in hand then it is probably the best thing you can do in practice anyway.

    One example would be to calculate the checksum like this:

    Code:
    checksum = Int(Abs(((((score xor 175623456)*126166)*(((score xor 17694546)+593)/7)-((564813-score)/9)) mod 676851)*6))
    It appears pretty random based on the score input but will be the same every time.

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    320
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I tested here and it works well enough I guess. Thanks very much!

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There is an app you can get on cydia that let's you send fake scores to GameCenter directly.

    One of my testers did it before I even added GameCenter scoring, so there is nothing you can do to prevent it inside your app. Apple is going to have to fix the issue.

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    320
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    dammit. Thanks for the info Urbanmonk.

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    A good way to fight it is to make the daily or weekly scores the default tab. The "hacker" would have to submit the score everyday if they wanted to stay at the top of those, and then have your app automatically submit new scores when players play.
    That might annoy more savvy users that monitor their data usage though. Having the ability to turn the feature off could help with that.

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    320
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    that's good idea! thanks Urbanmonk!

Similar Threads

  1. GC Leaderboard Object - can't see submitted scores
    By JoKa in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 19th December 2011, 07:54 PM
  2. Protecting a clock based game
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 15th April 2011, 08:24 PM
  3. Protecting Files
    By Fimbul in forum Multimedia Fusion 2 - Technical Support
    Replies: 23
    Last Post: 31st July 2009, 12:31 AM
  4. MMF2 - Protecting Code if Object is deleted
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th November 2008, 06:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •