• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by fanling3 · Jul 18, 2014 at 07:41 AM · androidiosgamesecurity

Better data protection for offline mobile game

I am making an offline mobile game and I am dealing with the security problem as my game has In-app purchase. So I do not want it to be cracked so easily. Of course perfect security is impossible so I just aim to prevent normal people to hack it so easily. Here are some methods I can t$$anonymous$$nk of:

1. Encryption of data in PlayerPref

Using plain text for data saving in PlayerPref is obviously dangerous, so my first barrier is to encrypt the data saved through PlayerPref. I use MD5CryptoServiceProveder provided by C#. And I use a string containing the deviceID so users cannot share their data to other users by simply replace the PlayerPref file.

2. Save and load sensitve data to PlayerPref

Because I have encrypted PlayerPref, simple hacking can be prevented. Then I need to protect the data before they are written to PlayerPref. The most common data is Score in a game. The score can be easily changed by memory searc$$anonymous$$ng if it is just a variable. It would be meaninigless to save a hacked data. So I usually save the score in realtime to PlayerPref and load it from PlayerPref everytime I need to change the score.

3. Group data into one string or add random strings

For example if I record whether the user completed level 1, 2, 3, I use 3 different variables and use PlayerPref.SetInt("Unlock1", 1), PlayerPref.SetInt("Unlock2", 1). It would be useless if the user completed 1 level, he can simply copy it for other levels. He does not even need to care about the encryption. In t$$anonymous$$s way, I would use one string to record the status of all levels. Or I can add some random strings so same data will look different after encryption.

Not sure the above methods are useful (maybe some one can crack it easily? And more importantly, create a hacking tool to let other user without hacking technique to use), or anyone can t$$anonymous$$nk of other low cost (money I mean) methods to protect the data. And remember I am talking about offline games here, so I cannot use servers.

Thnanks for advice.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by screenname_taken · Jul 18, 2014 at 08:04 AM

https://www.assetstore.unity3d.com/en/#!/content/10395

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

General mobile game developing questions 0 Answers

Unity Scaling for Android on 5.5. 0 Answers

Left, Right And Double Jump controll for android 2d game 0 Answers

Unity Android Suspend/Resume and Quit behaviour 1 Answer

Transparency working in the editor but not when I build 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges