Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Keychain and NSUserDefault?

I am new to objective C, I have created one application in that I have used both NSUserDefault and Keychain to store my user name and password. But I cant differentiate both. Please help to differentiate the both.

Thank you.

like image 777
Ganapathy Avatar asked Aug 23 '12 11:08

Ganapathy


People also ask

When should I use Core Data vs UserDefaults?

Core Data only fetches the information it needs to perform the requests the application makes. This is very different from the defaults system. The UserDefaults class loads the property list into memory to improve performance and it asynchronously writes the changes back to disk at appropriate times.

Why do we use keychain?

Keychain Access is a macOS app that stores your passwords and account information, and reduces the number of passwords you have to remember and manage. When you access a website, email account, network server or other password-protected item, you may be given the option to remember or save the password.

How secure is UserDefaults?

UserDefaults and securityThis storage is not encrypted at all so if an app other than your own obtains access to your user defaults store, your user's data is compromised. For example, simple preferences that can't be used to identify your users are okay to store in user defaults.


1 Answers

A keychain is an encrypted container that holds passwords for multiple applications and secure services. Apple Inc. uses keychains as password management system in Mac OS and iOS.

NSUserDefaults Provides a way for application behavior customization based on user preferences. Belongs to the Foundation framework for Cocoa and Cocoa Touch.

I got this from Tag Information of NSUserdefaults and keychain

like image 109
Aravindhan Avatar answered Sep 22 '22 03:09

Aravindhan