I'm trying to make blowfish hashing available to php on a debian server.
Taken from the php manual on the crypt() function ( http://php.net/manual/en/function.crypt.php ), the following code checks for cryptographic functions...
<?php
echo("DES is " . CRYPT_STD_DES."<br>Extended DES is ".CRYPT_EXT_DES."<br>MD5 is ".CRYPT_MD5."<br>BlowFish is ".CRYPT_BLOWFISH."<br>");
if (CRYPT_STD_DES == 1) {
echo 'Standard DES: ' . crypt('rasmuslerdorf', 'rl') . "<br>\n";
}
if (CRYPT_EXT_DES == 1) {
echo 'Extended DES: ' . crypt('rasmuslerdorf', '_J9..rasm') . "<br>\n";
}
if (CRYPT_MD5 == 1) {
echo 'MD5: ' . crypt('rasmuslerdorf', '$1$rasmusle$') . "<br>\n";
}
if (CRYPT_BLOWFISH == 1) {
echo 'Blowfish: ' . crypt('rasmuslerdorf', '$2a$07$usesomesillystringforsalt$') . "<br>\n";
}
if (CRYPT_SHA256 == 1) {
echo 'SHA-256: ' . crypt('rasmuslerdorf', '$5$rounds=5000$usesomesillystringforsalt$') . "<br>\n";
}
if (CRYPT_SHA512 == 1) {
echo 'SHA-512: ' . crypt('rasmuslerdorf', '$6$rounds=5000$usesomesillystringforsalt$') . "<br>\n";
}
echo "System salt size: ". CRYPT_SALT_LENGTH;
?>
The result on my server shows the following hashes as available:
testDES is 1 Extended DES is 0 MD5 is 1 BlowFish is 0 Standard DES: rl.3StKT.4T8M MD5: $1$rasmusle$rISCgZzpwk3UhDidwXvin0
Whereas on my local ubuntu machine I appear to have blowfish and the sha family available.
What do I need to install to get blowfish running in php on debian 5.0?