登录用户的最佳方式是什么:
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/