13 require_once(
$baseDir.
'/lib/_autoload.php');
16 echo
"Enter password: ";
20 echo
"Need at least one character for a password\n";
25 foreach (array_chunk(hash_algos(), 6) as $chunk) {
26 foreach ($chunk as
$algo) {
27 $table .= sprintf(
'%-13s', $algo);
32 echo
"The following hashing algorithms are available:\n".$table.
"\n";
33 echo
"Which one do you want? [sha256] ";
39 if (!in_array(strtolower(
$algo), hash_algos(),
true)) {
40 echo
"Hashing algorithm '$algo' is not supported\n";
44 echo
"Do you want to use a salt? (yes/no) [yes] ";
45 $s = (trim(fgets(STDIN)) ==
'no') ?
'' :
'S';
47 echo
"\n ".SimpleSAML\Utils\Crypto::pwHash(
$password, strtoupper(
$s.$algo)).
"\n\n";
if(empty($password)) $table