Re: NSUserDefaults Password
Re: NSUserDefaults Password
- Subject: Re: NSUserDefaults Password
- From: Nicko van Someren <email@hidden>
- Date: Mon, 11 Oct 2004 16:05:27 +0100
On 11 Oct 2004, at 15:44, email@hidden wrote:
I wonder whether there is an easy way to store a passwort encrypted
(or otherwise unreadable at a first look) in the user defaults.
Thanks for any suggestion!
Are you trying to store something to send out to another program or are
you trying to store a value which the user will need to match in order
to gain access to something your application holds?
If you are trying to store some password so that your program can send
it out to another program then I suggest you use Keychain rather than
trying to hide it in the user defaults. Apple have already done a good
job working out strong ways to protect passwords and you'd be better
off using it.
If you are trying to store a password that the user must match in order
to gain access to data held by your application then one option is to
store the hash of the password concatenated to a random salt and when
the user enters their password you hash it in the same way and check if
the hashes match. An even better solution is to hash the password and
some salt to derive a key and then use that key to encrypt the data to
be protected.
Cheers,
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden