비밀번호 보호에 대한 글을 읽고 코드가 올바른지에 대한 의견을 듣고 싶습니다. 복어와 crypt()
을 함께 사용하여 누군가 암호를 해독하지 못하게하려고합니다. 또한, 나는 질문이있다. 암호를 저장할 때 변수가 $string
이므로 로그인 할 때 다시 사용자를 확인할 때 사용할 수 있다고 가정합니다.블로우 피쉬와 크립트 성공 사례?
function unique_md5() {
mt_srand(microtime(true)*100000 + memory_get_usage(true));
return md5(uniqid(mt_rand(), true));
}
//unique_md5 returns a random 16 character string
$string = '$2a$07$' . unique_md5();
$password = 'password';
$password = trim($password);
$protected_password = crypt($password, $string);
//then store the variables $string and $protected_password into the database
http://www.chilkatsoft.com/p/php_blowfish.asp - Google –
'$ cleartext' 나는 암호화되는 것으로 가정하고 있습니까? – jason328