php - 使用javascript获取密码的哈希值,然后将其发送到服务器

标签 php mysql

登录用户的最佳方式是什么:

1) 先用javascript获取密码的哈希值,发送到服务器,然后与数据库中存储的哈希值进行比较。

2) 将密码以明文形式发送到服务器,得到哈希值,然后与数据库中存储的哈希值进行比较。

最佳答案

Get first the hash of the password with javascript, send it to the server and then compare it with the hash stored in the database.

。如果这样做,则输入到服务器的密码与存储在数据库中的密码相同,是不安全的。

Send the password in plain text to the server, get the hash and then compare it with the hash stored in the database.

没有。使用 SSL,以便使用公钥加密发送密码。然后在服务器上对其进行哈希处理(使用盐)并将其与数据库中的密码进行比较。

关于php - 使用javascript获取密码的哈希值,然后将其发送到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11073145/

相关文章:

php - 推特 API : Who unfollowed from me?

PHP cURL - 如何通过 HTTP 请求将变量的内容作为文件上传?

mysql - 使用左连接和内连接在 SQL 中连接 4 个表

mysql - Sequelize - 从未创建连接表

php - 填充连接表

php - 在同一个 Controller 中调用其他函数?

php - 如何在 PHP 中启用跨域 POST-ing?

php - CodeIgniter 中的 sha1?

mysql - SQL表设计问题

java - 两个 docker 容器之间通信出现问题