Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nichlaspro

macrumors member
Original poster
Jan 21, 2015
82
1
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>??

Thanks!!!!
 
Last edited:

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
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.
 

nichlaspro

macrumors member
Original poster
Jan 21, 2015
82
1
You could salt and encrypt the data before putting it in NSUserDefaults. Or use the iOS keychain. But nothing is secure against someone capable of disassembling and reverse engineering your app's code.

Thanks!!!

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!
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.