- crypt: documentation ( source)
<?php
$salt = "Salz in der Suppe";
$url1 = "http://gibtsnicht.eazy-living.de/?p=91";
$url2 = "http://gibtsnicht.eazy-living.de/?p=92";
$password_hash = crypt($url1, $salt);
if (crypt($url1, $password_hash) == $password_hash){
echo "I'm on!\n";
}
if (crypt($url2, $password_hash) == $password_hash){
echo "I'm on but should not be!\n";
}
echo "=============================\n";
$salt = '$2y$07$usesomesillystringforsalt$';
$url1 = "http://gibtsnicht.eazy-living.de/?p=91";
$url2 = "http://gibtsnicht.eazy-living.de/?p=92";
$password_hash = crypt($url1, $salt);
if (crypt($url1, $password_hash) == $password_hash){
echo "I'm on!\n";
}
if (crypt($url2, $password_hash) == $password_hash){
echo "I'm on but should not be!\n";
}