Keychain VS NSUserDefaults
来源:互联网 发布:沪江1212知乎事件 编辑:程序博客网 时间:2024/06/05 05:08
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).
Instead of using NSUserDefaults, you would be better off using iOS Keychain Services. It's main purpose is to securely store user credentials. Apple has already done all the hard work for you. Take advantage of it.
- Keychain VS NSUserDefaults
- iOS—keychain,NSUserDefaults
- KeyChain
- keychain
- keychain
- KeyChain
- keychain
- Keychain
- Keychain
- keychain
- KeyChain
- Keychain
- keychain
- keychain
- keychain
- iOS应用程序安全(20)-本地数据存储及其安全性(NSUserDefaults, Keychain,CoreData, Sqlite, Plist 文件)
- NSUserDefaults
- NSUserDefaults
- mac curl 使用方法(转载)
- 解决centos下MYSQL无法启动但存在锁定sock的问题
- Mac Lion安装wget工具
- pcb加工对pcb设计的要求
- Hibernate中No row with the given identifier exists问题的原因及解决
- Keychain VS NSUserDefaults
- 操作系统如何使用显卡
- 转 mysql my.cnf的优化
- Earth Mover's Distance
- Android: NDK编程入门笔记
- 关于OutOfMemoryError: Java heap space的备忘
- 35点让你掌握google PR值
- dataGridView单元格内容更改事件
- 基于Soap协议的android客户端和服务器的数据交互(学习天气预报例子的心得)