Skip to content

Instantly share code, notes, and snippets.

@adivinho
Forked from ianmariano/genhash
Created March 4, 2019 13:12
Show Gist options
  • Save adivinho/02086affd64f4c35fdc3743a72e438b0 to your computer and use it in GitHub Desktop.
Save adivinho/02086affd64f4c35fdc3743a72e438b0 to your computer and use it in GitHub Desktop.
generate a base-64 encoded sha-256 password hash with openssl on the command line
# generate an SHA-256 password hash base64 encoded
echo -n "password" | openssl dgst -sha256 -binary | openssl base64
# better yet, use pepper (suffix the password with the pepper)
echo -n "passwordpepper" | openssl dgst -sha256 -binary | openssl base64
# better yet, use salt (prefix the password with the salt)
echo -n "saltpassword" | openssl dgst -sha256 -binary | openssl base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment