Closed xrat closed 9 years ago
Found the cause: base64
as used in lanzz's script is wrapping lines and hence introducing newlines if used in conjunction with openssl dgst -sha512
. Since the base64 of a sha512 is over 80 chars long we need to use base64 -w0
to disable wrapping. Using for instance
hash=$(echo -n "$hash" | openssl dgst -sha512 -binary | base64 -w0 | tr +/= 98A)
all method sha512 tests from https://github.com/chriszarate/supergenpass-lib/blob/master/tests/simple.js are OK.
I was trying to reproduce passwords using a shell script such as https://github.com/lanzz/bash-supergenpass . It works for MD5 but not for SHA512. With MD5 in place (original code of lanzz's script) doing the test with
test
andexample.com
:If I change lanzz's code from
to
the result is
but it should be
sJfoZg3nU8
.