Birincisi, ben CRYPT_BLOWFISH kullanmak olduğunu görmek, i $ 2a $ ile başlayan bir 16 karakter tuz kullanmak gerekir. Ancak, php.net documentation for crypt() bazı sistemler CRYPT_BLOWFISH desteği yok diyor. Ne kadar sıklıkla durum olduğunu?
Sonraki, dokümanlar üzerinde kendi Örneğin, ben aşağıdaki gibi () kripti kullanın bakın:
<?php
$password = crypt('mypassword'); // let the salt be automatically generated
/* You should pass the entire results of crypt() as the salt for comparing a
password, to avoid problems when different hashing algorithms are used. (As
it says above, standard DES-based password hashing uses a 2-character salt,
but MD5-based hashing uses 12.) */
if (crypt($user_input, $password) == $password) {
echo "Password verified!";
}
?>
CRYPT_BLOWFISH kullanmak için, ben değiştirmeniz gereken tek şey bu yüzden gibi bunu yapmak için ilk satırı olacaktı;
crypt('mypassword', '$2a$07$usesomesillystringforsalt$')
ve sonra hatlarının kalanı olduğu gibi ince?