doushenmao9036 2011-05-25 20:56
浏览 44
已采纳

使用注册表单在DB中存储密码的安全方法是什么?

I have a register form called server with fields Name, IP, Password. The form will send the data prevously filled by operator, but the problems is:

How the field Password will travel until my insert verification code ?

some short example:

The form

<form method=POST action=myActPage.php>
  <input type=PASSWORD name=PWD value="" />
  <input type=SUBMIT value=GO />
</form>

THE PROBLEM IS HERE --- BETWEEN --- THE TRAFFIC --- password can be stolen here.. how to prevent it to happen?


The PHP Action Page

if ($_POST) {

   $pwd = $_POST['PWD'];
   $pwd = md5($pwd);

   $response = mysql_query("INSERT INTO tbl_pwd ('pwd') VALUES ('$pwd') ");

}

Thanks for any idea on this matter.

EDITED: I really spent almost two hours searching on stackoverflow and I found nothing on this specifc matter, thats is why the question. No question about the "traffic between form and php action script" Important: I'm looking for a solution without the use of SSL over HTTP.

  • 写回答

3条回答 默认 最新

  • dongque1462 2011-05-25 20:59
    关注

    If you're concerned about the password getting intercepted, you'll have to look into using HTTPS. Even if you hashed the password client-side, it would most likely still be susceptible to replay attacks.

    Edit

    As far as storing them, you don't want to use MD5 anymore. It's old and has flaws (see second paragraph). You should use a better hash algorithm such as SHA. You should also add a salt to them. The salt makes dictionary attacks more difficult, especially if you use a unique salt for every password. That will mean that even if two users have the same password, their hashes will be different.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探