android - 如何存储用于 Android 的 SQLCipher 中的 key

标签 android sqlite sqlcipher

我正在使用适用于 Android 的 SQLCipher。我已经完成了所有必要的事情 如 http://sqlcipher.net/sqlcipher-for-android/ 中所述加载库

我观察到您设置了密码,即 key :

    SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFile, "test123", null);

那么您的密码如何免受黑客攻击?因为它可以从 java 文件访问。 ?

有什么正确的方法可以存储密码吗?

谢谢, Nib

最佳答案

Then how is your password safe from a hacker?

不是。不过,硬编码密码短语可以进行简单的演示。

Is there any correct way where i can store the password ?

用户应通过您的用户界面提供用户数据库的密码。然后用户将密码短语存储在用户的头部,或者您可能将用户头部的内容与其他内容结合起来以进行轻量级双因素身份验证(例如,配对的蓝牙可穿戴设备的 MAC 地址)。

关于android - 如何存储用于 Android 的 SQLCipher 中的 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21987170/

相关文章:

android - Volley 认证 header

android - 将应用程序重新提交到 Google Play 商店,但仍然存在拒绝警告标志

Android/Web 应用程序离线/在线数据库设置。在两个平台上创建项目

php - 如何对模型执行删除操作?

swift - SQLite.swift 和 SQLiteCipher.swift 有人成功使用过吗?

java - Android 根据运行时值获取资源字符串

android - 如何膨胀自定义 View 类?

ruby-on-rails - SQLite3::BusyException

ios - Xcode 构建错误 - "Implicit declaration of function ‘sqlite3_key’ 在 C99 中无效”

ios - SQLCipher 和 CoreData 问题 : CoreData could not fulfill a fault for