- var_dump: documentation ( source)
- chr: documentation ( source)
- decbin: documentation ( source)
- crypt: documentation ( source)
- str_split: documentation ( source)
<?php
$pass = 'secret';
$salt = '$2y$07$usesomesillystringforsalt$';
$hash = crypt($pass, $salt);
var_dump(
$hash,
str_split($hash) // the 22th salt character 'e' is on index 28
);
function meow($password) {
echo decbin(chr(crypt($password, '$2y$07$usesomesillystringforsalt$')[28])), PHP_EOL;
}
meow('secret');
meow('boegaboe');
meow('42');
meow('Ford Prefect');
meow('Arthur Dent');