Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to safely store credentials entered in Application Preferences?

My iPhone App connects to a web service using a username and a password.

I prefer to save the credentials in the Application Preferences (settings bundle) like the Mail App. Is this secure enough? Is it possible to save those values to the keychain (via Application Preferences)?

Edit:

I want my users to enter their credentials in the Application Preferences of my App. Normally, I can retrieve this data in my app with NSUserDefaults. But Application Preferences saves the data as plain text and it's neither encrypted nor hashed. Is there a safe way? Eg. I know the keychain on the iPhone and I find it great! Can I use the keychain to hold the credentials entered in Application Preferences?

Food for thought: How does Apple do it? I mean, when I want to use the Mail App, I provide my username and password in the Application Preferences. Are those values stored as plaintext?

like image 887
Sandro Avatar asked Sep 21 '11 12:09

Sandro


People also ask

Where are user credentials stored?

The credential store, sometimes called the user store or the authentication store, is where the actual user credentials are stored. There are two main types of authentication stores being used with IdPs today: databases and directory stores.


2 Answers

Did you check the keychain documentation? On the security, see this white paper by the Fraunhofer SIT institute.

like image 117
Arne Avatar answered Sep 23 '22 17:09

Arne


Keychain Services will be required for secure storage. Using NSUserDefaults will not secure your data.

like image 35
CIFilter Avatar answered Sep 25 '22 17:09

CIFilter