简体   繁体   中英

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

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM