使用 MD5 从前端安全地向后端发送密码 [英] Sending password safely from the front-end to the back-end using MD5

查看:9
本文介绍了使用 MD5 从前端安全地向后端发送密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用 MD5 加密了我的数据库中的密码字段,并在我的后端对其进行了加密处理,但是当用户输入他们的密码时,它是纯文本的.

I've encrypted a password field in my DB by MD5, and I handle it encrypted in my back-end, but when user types their password in, it is in plain text.

有没有一种安全的方式将密码从前端传递到后端?MD5 在这种情况下没有意义...

Is there a safe way to pass the password from the front-end to the back-end? MD5 doesn´t have sense in this case...

注意:我使用的是 HTTPS 和 POST 方法.

NOTE: I'm using HTTPS and the POST Method.

推荐答案

您可以考虑以下步骤来保护密码:

You can think about the following steps to protect the password:

  1. 在传输过程中最好使用 HTTPS 和 HSTS 来保护密码;

  1. Use HTTPS preferably with HSTS to protect the passwords during transport;

使用 bcrypt 等密码哈希代替 MD5 来保护服务器上的密码.

Use a password hash such as bcrypt instead of MD5 to protect the password on the server.

  • 带有 salt 的 HASH 密码;
  • 为 bcrypt 使用较高的工作系数.
  • HASH passwords with salt;
  • use a high work factor for bcrypt.

MD5 不是最好的散列方式.MD5 不再被认为是安全的.

MD5 is not the best way to hash. MD5 is not considered secure anymore.

MD5 不加密;不要加密密码,散列它们,加密可以解密,散列不能反转.

MD5 is not encryption; don't encrypt passwords, hash them, encryption can be decrypted, hashing cannot be reversed.

这篇关于使用 MD5 从前端安全地向后端发送密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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