0

So I have made a game app using Unity and it stores a lot of information and data in the mobile's data path in this case Android. Now the user can definitely go there and alter the data i.e delete a file and that can lead to my app not working properly. So is there a way to maybe encrypt them so that the user cannot tamper with the data?

Files are of sound, pictures, etc.

Fydar
  • 374
  • 4
  • 8
  • you can use any encrypting mechanisms. I don't see any reason for them not to work in unity. – Bizhan Aug 15 '20 at 09:46
  • Can you guide me a bit about encrypting mechanisms and how I can make them work? I am a total beginner when it comes to encrypting.. – Owais Iqbal Aug 15 '20 at 10:17
  • you can see https://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp and https://learn.microsoft.com/en-us/dotnet/standard/security/encrypting-data – Bizhan Aug 15 '20 at 10:25

1 Answers1

0

You can encrypt files on the disk, but ultimately a player with malicious intentions would be able to slerp the keys used for encryption from the built version of the game. Because of this, I like to call it "Obscufication" rather than "Encryption", but please do try not to store sensitive information in there!

I recommend checking out this StackOverflow answer on how to perform encryption in C#.

If you want more security then you will need a server to store data on. Good luck!

Fydar
  • 374
  • 4
  • 8
  • Hi! thanks for the reply. My concern is even if I encrypt the data the user can delete the file itself right? Is there a way to keep the data as it is and not let the user be able to tamper it at all let alone be able to delete it? – Owais Iqbal Aug 22 '20 at 21:05
  • There is no way to prevent deletion of the file. I recommend you check out some way of getting the data in a database. – Fydar Aug 22 '20 at 22:47