iPhone SQLite密码字段加密 [英] iPhone SQLite Password Field Encryption

查看:98
本文介绍了iPhone SQLite密码字段加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好,男孩和女孩

希望这是一个快速简单的问题.

Hopefully this will be a quick and easy question.

我正在构建一个应用程序,要求用户输入其链接到的在线服务的登录详细信息.可以添加和保存多个登录详细信息,因为用户可能要在多个帐户之间进行切换.

I am building an App that requires the user to input their login details for an online service that it links to. Multiple login details can be added and saved as the user may have several accounts that they would like to switch between.

这些详细信息将存储在SQLite数据库中,并将包含其密码.现在的问题是:

These details will be stored in an SQLite database and will contain their passwords. Now the questions are:

1:这些密码是否应该在数据库中加密?我的直觉会说是",但随后我不知道设备和系统的安全性以及是否有必要.

1: Should these passwords be encrypted in the database? My instinct would say yes but then I do not know how secure the device and system is and if this is necessary.

2:如果应该对它们进行加密,我应该使用什么?我认为对整个数据库文件进行加密听起来有些过头,所以我应该在将密码保存到数据库之前先对其进行加密吗?如果是这种情况,我可以用什么来实现呢?我找到了对"crypt(3)"的引用,但在查找有关它或如何实现它方面遇到了麻烦.

2: If they should be encrypted what should I use? I think encrypting the whole database file sounds a bit over-kill so should I just encrypt the password before saving it to the database? If this is case what could I use to achieve this? I have found reference to a "crypt(3)" but am having trouble finding much about it or how to implement it.

我热切等待您的答复!

编辑:正如您将从所选答案和评论中看到的那样,KeyChain是我所追求的.任何对使用它感兴趣的人都可以在这里找到一些有用的源代码:

As you will see from the chosen answer and comments KeyChain is what I went with. Any one interested in using it there is some useful source code here:

http://log.scifihifi.com/post/55837387 /simple-iphone-keychain-code

推荐答案

不要实现自己的加密货币;只需使用钥匙扣即可.

Don't implement your own crypto; just use the keychain.

这篇关于iPhone SQLite密码字段加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆