Cyrus
Cyrus

Reputation: 3717

How do I store a password in Cocoa preferences?

I was going to store a password in my Cocoa application in the NSUserDefaults but then I realized that it is stored in plain text.

How do you store password credentials for Cocoa applications?

Upvotes: 4

Views: 1242

Answers (2)

Jason Fuerstenberg
Jason Fuerstenberg

Reputation: 1351

Encrypt it with BCrypt first.

I have an open source BCrypt utility class if you're interested...

[old link deleted]

Upvotes: 2

mttrb
mttrb

Reputation: 8345

Passwords should be stored in the Keychain. You should probably look at the Keychain Services Programming Guide to begin with. The Keychain exists on both iOS and OS X platforms.

Upvotes: 6

Related Questions