Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
This question was closed May 20, 2013 at 05:30 PM by DannyB for the following reason:

Too subjective and argumentative

avatar image
0
Question by DannyB · May 18, 2013 at 02:05 PM · playerprefsdatasecurity

Secure PlayerPrefs using hash signature

I am trying to create a relatively secure way to store some values in a way that the user will not be able to easily modify manually. The target platform is iOS and possibly Android.

My current plan is this:

  1. Save the value using PlayerPrefs.

  2. Save an MD5 hash of the value + secret string + unique device id.

Now, as far as I understand, the value can only be modified by my scripts, unless someone knows the secret string, and even so, it will only help for manipulating that specific device.

Does anyone see any major problems with this approach? Keep in mind, my main use case is to store some values that define what in app purchases were purchased.

Just to be clear, I am not interested in "you can do this instead" answers, but rather to understand what can be the flaws of the above approach.

For context, I would say that I have tested (and decided against) these:

  • Encrypted custom XML

  • SecurePlayerPrefs / EncryptedPlayerPrefs assets (available on the asset store and somewhere in the forums respectively)

  • Any solution that involves a server

Also, assume I have read most, if not all of the Unity Answers and Forums pages that I could find on the subject.

Thanks in advance.

Comment
Add comment · Show 10
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
avatar image Fattie · May 18, 2013 at 06:06 PM 0
Share

What's the reason you don't want to use Secured PlayerPrefs? It's great.

https://www.assetstore.unity3d.com/#/content/4962

http://forum.unity3d.com/threads/157606-Secured-PlayerPrefs-Release

"Just to be clear, I am not interested in "you can do this ins$$anonymous$$d" answers" Right. Just to be clear, I'm just interested in why you don't like Secured PlayerPrefs.

avatar image Fattie · May 18, 2013 at 06:12 PM 0
Share

"to understand what can be the flaws of the above approach "

well the unique device id is instantly knowable by anyone , so it's almost not worth putting it in as a salt

"$$anonymous$$eep in $$anonymous$$d, my main use case is to store some values that define what in app purchases were purchased"

Alright, I'll keep that in $$anonymous$$d :) is this iOS in app purchase? In that case you have your own stateful server anyway to check that receipts are used uniquely, so just use that?

(if you don't check receipts on the app store you will be instantly, widely "hacked")

Als note that you're including all of the relevant .net library anyway to do a hash, so would it actually be simply easier / more $$anonymous$$ISS for you to just encrypt the string?

avatar image Graham-Dunnett ♦♦ · May 18, 2013 at 06:22 PM 4
Share

$$anonymous$$y concern with the approach is that the secret string will be stored in the application and so can be reversed engineered out of the application. Your approach may be okay to stop casual piracy, but is not sufficient to prevent piracy. Never trust anything on the client.

avatar image DannyB · May 18, 2013 at 06:50 PM 0
Share

Well, not many things can actually prevent piracy, and that is not my intention to try here. All I want to do, is to make it less obvious for the average person who browses their iPhone folders to just change a .plist value in order to get that IAP. I am hoping that my approach would force them to either buy, or to go get that pirated version that someone else made, if it is available.

@Fattie - It's not that I don't like these external solutions - I just don't need them. They seem to provide more or less what I do here, so I am rolling my own solution with more control and less external dependencies. A matter of preference.

As for doing a two way encryption ins$$anonymous$$d of one way signature, it will suffer from the exact same issues as a one way signature so it is immaterial I think.

avatar image whydoidoit · May 19, 2013 at 06:41 AM 2
Share

If by "the casual hacker" you mean someone who goes looking for a text file, reads it, mods it and off they go then any kind of $$anonymous$$D5 hash is overkill. Just XOR all of the characters with something and be done with it. Anyone who wants to hack your game and knows what they're doing will get through it by looking for things which could be your secret string in the decompiled code, which will only be at all difficult if you've obfuscated the code you ship - even they I bet there's a 100 programs that search IL assemblies looking for $$anonymous$$D5 hash algorithm/access to standard ones.

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Player Pref Security - iOS 2 Answers

Deleting PlayerPrefs Data 1 Answer

Making a less complicated save system. 2 Answers

Hacking Unity3d Games 1 Answer

Storing persistent data 1 Answer


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