如何使用PHP加密数据库中的密码数据? [英] How can I encrypt password data in a database using PHP?

查看:362
本文介绍了如何使用PHP加密数据库中的密码数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PHP和CodeIgniter框架连接到MySQL数据库。我想将加密的密码存储在数据库中,并希望了解这样做的最佳方法。

I am connecting to a MySQL database with PHP and the CodeIgniter Framework. I want to store my passwords encrypted in the database and would like to know the best way to do this.

推荐答案

级别概述 - 不加密,散列。如果可以,使用BCrypt。 这里有一篇长篇文章解释为什么BCrypt 和为什么哈希。

From a high level overview - don't encrypt, hash. And if you can, use BCrypt. Here's a long article explaining why BCrypt and why hashing.

这篇关于如何使用PHP加密数据库中的密码数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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