- substr: documentation ( source)
- var_dump: documentation ( source)
- decbin: documentation ( source)
- crypt: documentation ( source)
- str_split: documentation ( source)
- ord: 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($char) {
$hash = crypt('secret', '$2y$07$usesomesillystringfor' . $char);
$char = substr($hash, 28, 1);
$dec = ord($char);
$bin = decbin($dec);
var_dump(
$hash,
$char,
$dec,
$bin
);
}
$alphabet = str_split('abcdefghijklmnopqrstuvwxyz');
foreach($alphabet as $char) {
meow($char);
}