From 0102ca26c3c3d512a1320df9e5d2e261ddb6ade8 Mon Sep 17 00:00:00 2001 From: r00t Date: Sun, 27 Nov 2016 12:23:11 -0500 Subject: [PATCH] more oops. still not 100% sure on the php one. --- docs/HOWTO.hashgen | 4 ++-- extra/bin/hashgen.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 extra/bin/hashgen.php diff --git a/docs/HOWTO.hashgen b/docs/HOWTO.hashgen index 42b502e..e885b0e 100644 --- a/docs/HOWTO.hashgen +++ b/docs/HOWTO.hashgen @@ -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\$')" -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): diff --git a/extra/bin/hashgen.php b/extra/bin/hashgen.php new file mode 100644 index 0000000..1476ba9 --- /dev/null +++ b/extra/bin/hashgen.php @@ -0,0 +1,7 @@ +