【发布时间】:2014-04-01 07:50:01
【问题描述】:
我正在考虑对目前具有以下功能的系统进行简单的密码升级:
md5(md5($pass) . $user);
密码在发送前会通过 JavaScript 哈希算法,这总是会生成大约 20 多个字符的三字符密码。
我认为使用散列密码的结尾作为 KEY 和 IV 来加密其余部分就足够了。
$pass = '20_plus_characters_long';
$hash = openssl_encrypt(substr($pass, 5, -5), 'aes-128-cbc', substr($pass, 0, 5), false, md5(substr($pass, -5), true));
我说的对吗?
【问题讨论】:
-
你为什么在 javascript 中散列密码而不是使用 SSL;为什么还要在 PHP 中加密
hash? -
我会投票反对(两个想法)。看看crackstation.net/hashing-security.htm
标签: php encryption passwords openssl md5