is it safe to save info in PlayerPrefs?

i need to save some info in my game running on android.
device i saw that i can use PlayerPrefs for this. the question is how safe is this?
can i save the amount of in game money the user earned for example?
does the data encrypted some how?

p.s, unity document speak only on windows,osx, linux and web. doesn’t say anything about mobile…

I guess the data is saved to android.content.SharedPreferences.

So this definitely needs some encryption if you want to store sensitive info (rooted devices are not protected from modification). Encrypting the file itself may be not a very good idea. You could encrypt the value, but another threat here is a “Replay attack” when the whole encrypted value in the file is replaced by a known encrypted value that means much gold :slight_smile: You need to decide the desired level of security/paranoia.

You also might want to check

HTH

Yes, it’s safe. The data isn’t encrypted, but since you’re on Android, it probably won’t matter as much, because Android by default doesn’t allow for users to edit it. The user can always download a file manager, but then again, nothing is unhackable.

-David