简体   繁体   English

为什么要在iPhone应用程序的钥匙串中存储用户名和密码

[英]Why to store username and password in Keychain in iPhone app

I have worked with NSUserDefault but this keychain concept is totally new for me. 我曾与NSUserDefault合作,但是这个钥匙串概念对我来说是全新的。

I have tried looking for similar Questions but couldn't find the exact reason to do so. 我曾尝试寻找类似的问题,但找不到确切的理由。

What I have done: 我做了什么:

I already know how to store data in NSUserDefault . 我已经知道如何在NSUserDefault存储数据。 and also the reason why do we need to store it. 以及我们为什么需要存储它的原因。

Regarding Keychain I just know that storing in keychain stores the data with some extra security by encoding the original text while NSUserDefault stores the data as plain text. 关于钥匙串,我只知道在钥匙串中存储可以通过对原始文本进行编码NSUserDefault存储数据,而NSUserDefault将数据存储为纯文本,因此具有额外的安全性。 And it also stores the data even after the application is removed. 并且即使删除了应用程序,它也会存储数据。

Is this the only reason for storing the data in keychain? 这是将数据存储在钥匙串中的唯一原因吗?

Edit: I got this link which says exactly what I have said. 编辑:我有这个链接 ,它确切地说了我说的话。

Keychain data is more secure in comparision of NSUserDefault. 与NSUserDefault相比,钥匙串数据更安全。 and keychain data also in device after remove application from device. 从设备删除应用程序后,设备中的钥匙串数据也将在设备中。 For more about keychain wrapper read this. 有关钥匙链包装的更多信息,请阅读此内容。

maybe LKKeychain could help: 也许LKKeychain可以帮助:

LKKeychain class is a tiny keychain services wrapper. LKKeychain类是一个很小的钥匙串服务包装器。 It provides: 它提供:

Add account Update account Delete account Dump accounts (for debug) 添加帐户更新帐户删除帐户转储帐户(用于调试)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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