On Sun, May 1, 2022, 09:11 billib <[email protected]> wrote:

> My script comes up with a password, GUAC_PASS. The next line gives the
> text that is written into user-mapping.xml:
>
>     GUAC_PASS_ENC=$(echo ${GUAC_PASS} | openssl md5 | cut -d' ' -f2)
>
>
> I tried
>
>     echo "mypassword" | openssl md5
>
>
> (with and without double quotes) and
>
>     echo "mypassword" | md5sum
>
>
> on the command line as well which gave the same results as the script,
> respectively.
>

Use echo -n instead. The "echo" command will otherwise include a newline
character at the end, which is causing the checksum to not match. You are
currently actually hashing "mypassword\n", not "mypassword".

- Mike

Reply via email to