PHP crypt() Blowfish Function Not Working
问题 This is my first time using the crypt() function in PHP, and I can't figure out why it isn't working. My code is based on this article: http://www.techrepublic.com/blog/australia/securing-passwords-with-blowfish/1274 function blowfishHash ($pw) { //generate random salt $salt = "$2y$10$"; for ($i = 0; $i < 22; $i++) { $salt .= substr("./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", mt_rand(0, 63), 1); } $hash = crypt($pw, $salt); //printout to file $file = fopen("debug.txt",