Secured PlayerPrefs - Release

Hi Unity developpers !

I’m releasing a Secured PlayerPrefs utility in the asset store today, you can get it here - Secured PlayerPrefs | Tools | Unity Asset Store

It allows you to secure stored data in your game, and avoid problems with players cheating or trying to get free stuff by just modifying some file or system preferences.

For example, I’m working on a freemium game (the game is free, but you can buy stuff in it). I need to store somewhere secure which items the user bought. If I was using PlayerPrefs a malicious player could edit registry in Windows, or an ASCII file in OS X, Android and iOS. To prevent this, I developped “Secured PlayerPrefs”, it acts like PlayerPrefs but it stores a crypted and signed file.

  • It prevents someone who wants to cheat or “steal” items and virtual money.
  • It prevents people to exchange or copy their backup, to give items and virtual money to anyone else. (This is done by a 2-keys algorithm, the first key is defined in your program, the second is defined by the device itself)

If you need support or if you have feature requests, contact me here or go to http://taliwut.tumblr.com

Hi Taliwut,

nice approach to make playerprefs more secure! Just a question out of interest. On your Asset Store main image, I can see there’s a secret key hardcoded in the script. Wouldn’t it be possible to decompile the game code, get this key and reverse engineer the other key so they match?

Thanks.

Yes it’s possible to decompile the game code and get the key. But it’s very difficult to use this key to generate new valid saves.

Following this… :slight_smile:

This sounds very interesting. How do we use it? Same as saving regular Playerprefs?

Yep, Same as saving regular PlayerPrefs + some convenience methods I needed for my game. - API documentation is available here

Excellent. Purchased! :slight_smile:

Thanks !

I’m waiting for feature requests :wink:

Could you please integrate some of these methods?

http://wiki.unity3d.com/index.php/ArrayPrefs2

That will be a major buying factor for me :slight_smile:

Thanks, good suggestion ! Hope to announce you the next version soon :wink:

Hi,

I implemented new methods inspired by http://wiki.unity3d.com/index.php/ArrayPrefs2

For those who already bought the plugin, send me your invoice number and I will send you the beta unity package.

I just submitted a new version to the asset store with these new methods:

    void SetBool(string key, bool newValue)
    bool GetBool(string key, bool defaultValue)
    void SetIntArray(string key, int[] newValue)
    int[] GetIntArray(string key, int[] defaultValue)
    void SetStringArray(string key, string[] newValue)
    string[] GetStringArray(string key, string[] defaultValue)
    void SetFloatArray(string key, float[] newValue)
    float[] GetFloatArray(string key, float[] defaultValue)
    void SetVector2(string key, Vector2 newValue)
    Vector2 GetVector2(string key, Vector2 defaultValue)
    void SetVector3(string key, Vector3 newValue)
    Vector3 GetVector3(string key, Vector3 defaultValue)
    void SetColor(string key, Color newValue)
    Color GetColor(string key, Color defaultValue)
    void SetQuaternion(string key, Quaternion newValue)
    Quaternion GetQuaternion(string key, Quaternion defaultValue)

    // Return a JSON string representation of all keys and values stored.
    // Used if you want to synchronize over network.
    string ToJson()

Version 1.3 has been accepted by the Unity team. You can update it on the asset store !

Nice work… Seems to be dll based, so few Q’s before buying this…

  • I assume fully tested on iOS Android?
  • Will you support Flash WP8 (When it comes out)?
  • Are you using playerprefs or your own file solution to store encrypted data?
  • Are you using Unity’s device id (SystemInfo.deviceUniqueIdentifier) API to generate 2nd (device) key or something else?

Thanks in advance…

It has been tested on iOS, Android, OS X and Windows

It should work everywhere, but I’m trying to test released version all devices I own.

I’m using my own file solution to store encrypted data. I also store versions history, and rollback to previous versions if the player try to manipulate the main save game (he will not be able to do it, so he will corrupt it).

Yes I’m using a compound key that is generated from SystemInfo.deviceUniqueIdentifier so users can’t exchange their save games.

Note: I’m planning to add a secured server backup / restore.

1 Like

Thanks for the replies, you’ll probably have a new customer soon… :slight_smile:

I am interested in using this for ios and with some prime31 plugins to use icloud and iap.
Does “secured playerprefs” will work with them?

First, I didn’t tried iap and icloud with Secure PlayerPrefs.

  • I see no problems with iap.

  • But with icloud, I see one big problem: if the user got 2 iOS devices connected on the same iCloud account, and if you try to synchronize the output files from Secured PlayerPrefs plugin, it will not work because of the different device ids. A solution could be the integration of an optional “prime 31 icloud” support in Secured PlayerPrefs. But I don’t know if iCloud data storage is secure (I hope so) or if it could be a source of data manipulation.

Hi there,

I’m looking for beta testers for the new feature of “Secured PlayerPrefs” plugin: server synchonization. Contact me directly at taliwut gmail com or via PM. Users who bought it have priority.

Thanks !

If you guys like bitcoin, you can buy Secured PlayerPrefs here - https://www.coindl.com/page/item/634