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 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置