more oops. still not 100% sure on the php one.

This commit is contained in:
brent s. 2016-11-27 12:23:11 -05:00
parent 6f53d09b04
commit 0102ca26c3
2 changed files with 9 additions and 2 deletions

View File

@ -20,9 +20,9 @@ There are many ways in which you can generate a salted hash.


python -c "import crypt, getpass, pwd; print crypt.crypt('PASSWORD','\$6\$aBcDeFgHiJ\$')" python -c "import crypt, getpass, pwd; print crypt.crypt('PASSWORD','\$6\$aBcDeFgHiJ\$')"


3.) php: 3.) php (extras/bin/hashgen.php) (UNTESTED):


php -r "\$password = readline('Password: '); \$saltRaw = random_bytes(8); \$salt = base64_encode(\$saltRaw); \$result = crypt(\$password,'\$6' . '\$' . \$salt .'\$'); print \$result . \"\n\";" php -r "\$password = 'PASSWORD'; \$saltRaw = 'aBcDeFgHiJ'; \$salt = base64_encode(\$saltRaw); \$result = crypt(\$password,'\$6' . '\$' . \$salt .'\$'); print \$result . \"\n\";"


4.) even grub-crypt (if using legacy grub): 4.) even grub-crypt (if using legacy grub):



7
extra/bin/hashgen.php Normal file
View File

@ -0,0 +1,7 @@
<?php
$password = readline("Password: ");
$saltRaw = random_bytes(8);
$salt = base64_encode($saltRaw);
$result = crypt($password,'$6' . '$' . $salt .'$');
print $result . "\n";
?>