Sravan Goud
Sravan Goud

Reputation: 197

Save username-password with iOS Keychain Services., how and how much safe?

I need to save User Name and Password in Keychain Services.. I am planning to place a round rect button in IB. On pressing of which the User name and Password would be saved in Keychain Services., so that when user kills the application and tries to login again after some time, they do not need to enter their login details again

Upvotes: 0

Views: 679

Answers (1)

krishna
krishna

Reputation: 114

Encryption will give you some security. The problem is your program would also have to decrypt the password, which means it must have the key stored in it somewhere. This will make it vulnerable to reverse-engineering. A better approach is to use an one-way function (such as a hash) on the password and store that hash value. When a user enters a password, you then apply the one-way function to the password and compare the result to the stored value. In this manner, the password cannot be compromised (well, there's always a dictionary attack, but that's a matter of password strength).

Upvotes: 2

Related Questions