How To Store Data Secure, So Users Can't Edit Them?

Discussion in 'iOS Programming' started by nichlaspro, Mar 6, 2015.

  1. nichlaspro, Mar 6, 2015
    Last edited: Mar 6, 2015

    nichlaspro macrumors member

    Jan 21, 2015
    Hi All!!

    Usually i store my data in NSuserDefaults but that can easily be accessed by the users...Or can i secure that data on the local storage>?

    But how i can i store the data in a safe please where the users can't change the values and all that>??

  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    You could salt and encrypt the data before putting it in NSUserDefaults. Or use the iOS keychain. If you just want to prevent editing you could store a salted hash in the keychain (avoiding any potential export restrictions for using encryption). But nothing is secure against someone capable of disassembling and reverse engineering your app's code. But sometimes just obfuscating the data (storing numbers backwards, etc.) is enough against tourists.
  3. nichlaspro, Mar 6, 2015
    Last edited: Mar 8, 2015

    nichlaspro thread starter macrumors member

    Jan 21, 2015

    Ok, i think i will do that encrypting the data before saving it...But how can i do that??

    Btw I've googled how to and can't find the solution for that:(( But I really want to know this because it's the final thing I gotta do with my app before submitting it...

    i appreciate it!

    Edit: I got it... I wanted to save my integers, so I converted so integers to strings and then to data which I encrypted, then saved it and it can't really be changed by the users.. So thanks for the tip Firewood!

Share This Page