加密/ SQLite中解密密码(Android版) [英] Encrypt/decrypt password in Sqlite (Android)

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

问题描述

在开发将特定用户的日期存入SQLite数据库的Andr​​oid应用程序,应该怎么处理用户的密码安全?我怎样才能加密密码,使其不会出现中明确在数据库中,但这样我就可以在需要的时候在应用程序解密。

In developing an Android application that will store certain user date into a sqlite database, how should I handle a user password securely? How can I encrypt the password so that it does not appear "in the clear" in the database, but so I can decrypt it in the application when needed.

推荐答案

最好的办法是存储的 SHA-2密码的的(或一些其它类型的散列的),然后比较这些散列而非实际解密密码的

The best approach would be to store SHA-2 (or some other type of hash) of the password, and then compare those hashes instead of the actual decrypted passwords.

存储密码是一个不好的做法,即使是加密是不安全的。请记住,一切都可以被打破。你能做的最好的就是让为黑客事情变得更加困难。

Storing passwords is a bad practice and is not secure even if they are encrypted. Remember, everything can be broken. The best you could do is to make things more difficult for the hacker.

这篇关于加密/ SQLite中解密密码(Android版)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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