Reputation: 6206
I'm working on an app that uses a certain webapp's API. The API requiers the (plain-text) user password to be passed on each call. As I'm unfamiliar with password best-practices (especially on mobile devices), I'm wondering what would be the best way and place to store the user password in my iPhone app. Any help is greatly appreciated.
Upvotes: 1
Views: 543
Reputation: 1470
i store my encrypted password in NSUserDefaults. However, plain text passwords shouldn't go here as per my previous answer.
Upvotes: -1
Reputation: 6875
If you're storing sensitive data, you should be using the keychain. The API is a pain to use, but there is some good sample code out there.
NSUserDefaults is easy to use but offers no encryption. If the user's iTunes backup isn't encrypted, you can just run strings on the right backup file to see your stored preferences in plaintext (I confirmed this last week). See this thread.
Upvotes: 5
Reputation: 73966
Don't use NSUserDefaults
, secure storage of passwords is exactly what the keychain services are for.
Upvotes: 2