Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
avatar image
0
Question by goodguy · Apr 16, 2018 at 08:35 AM · securitydata storagepersistence

How easy it is to fake data stored in Application.persistentDataPath?

I was just wondering how easy it would be to fake serialized data objects stored in Application.persistentDataPath? I mean does unity create some kind of signature for them or something like that? I just couldn't find anything like this on the docs. Is it possible to simply load and deserialize data objects saved by another application (with the same package id) change their values, serialize them again and just feed back them to the 'victim' app. If it is possible, then what is the "standard" approach to avoid this (if there's one at all)? E.g. If I deal with some kind of sensitive data stored in JSON I just use MD5 hash of all it's key/value pairs followed by a salt value stored in some unreachable / hardly reachable location.

p.s. I just can't check it out myself now, so I'd be grateful if somebody who knows this mechanism explained it to me

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
1
Best Answer

Answer by Bunny83 · Apr 16, 2018 at 09:32 AM

Ok based on your mention of "packege id" i guess you actually talk about an android build? You should be more clear about your case.


The actual path that is returned by "Application.persistentDataPath" depends on several things. Of course the most important thing is your target platform. Specifically for android it depends on if internal or external storage is used and may depend on where the App is stored. Generally for non-rooted devices the internal folder is "rather" safe while the external (SD card) folder can of course be simply accessed by the user. However if security is an issue, just forget about storing sensitive data on the device ^^. A rooted device has access to all files / folders on a device. Even without rooting it's possible to tinker with internal files through the PC backup functionality. You can create a backup of your device, use a software on the PC to extract / unpack files from the backup, modify them and repack the backup. If you restore that backup the internal files would have been changed.


That's why all major apps with sensitive data store it on their own server. Though since your question is kinda abstract we can not really recommend something specific for your case. Is it single player or multiplayer? How important is that data?


Keep in mind the golden rule: "Never trust a client". This does not only apply to client / server connections but is a general rule for anything that actually runs on the client. Nothing is 100% safe when it reaches a user device, ever.


Using checksums is useful to identify modified or corrupted data (keep in mind that corruption doesn't have to be a sign of someone trying to cheat). The question is what actions you take when you identify corrupted data? Another way is to store the same data with different encryption at several places. This could allow to identify a single change which could be "corrected".


Generally there's not "right" way to store data and no "common" or "recommended" way. It completely depends on the sensitivity of the data, where it is generated, etc... Using uncommon strategies provides the best obviouscation. Though as you may know security through obscurity is no real security.

Comment
Add comment · Show 2 · 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
avatar image Bunny83 · Apr 16, 2018 at 09:38 AM 0
Share

The behaviour of the persistantDataPath has changed over time and depends on the install location and the permissions set. See this answer for a bit more clarity

avatar image goodguy · Apr 16, 2018 at 10:44 AM 0
Share

Thanks for your detailed answer! I know about common data security and server side storage. I came to unity with almost 10 years of game development background in Flash and AIR. So my question was not exactly about it. It was simple, does unity provide some built-in way to sign serialized data or not. It's kind of YES or NO question. This security is not real of course, but anyway, a simple sign process makes it a bit harder to simply read and replace data. In this case one has to decompile the app or look for a hidden key string using some other way like HEX editor for example. And if key is composed on the fly and the app is obfuscated, sometimes it makes some "newbie hackers" stop trying :-D But anyway, I was just curious about it. And you answered my question

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.

Follow this Question

Answers Answers and Comments

77 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 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 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 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

sqlite encryption question 1 Answer

Need advice on best way to Save objects in one project and load them in anouther. 1 Answer

Keep Singleton while creating holder GameObject at runtime? 1 Answer

Trading card game uniqe id generation 2 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