Hi,
I am adding something akin to a 'privilege level' in my app ... for e.g admin vs user. It's a simple but crucial setting, because you can delete data for other users with the admin settitng. I am debating between using NSUserDefaults or Keychain to store this setting locally. With NSUserDefaults, I plan to use NSKeyedArchiver witth secureCoding, to encode this into an NSData, and then save it to user defaults. Is there any issue with storing semi-sensitive data this way?
I know that for things like passwords, keychain is the recommended option, where the act of 'reading' the valuable data is itself a problem. But in this case, I dont care if an attacker can read whether it's an admin account or not, but it would be a problem if they can modify the value themselves, and I'm not sure if they can do this if the value is stored in NSUserDefaults using secure coding. If it's a scrambled bit of NSData, an attacker shouldn't be able to change the value to a different setting and save it back to NSUserDefaults, can they?