Skip to content

Instantly share code, notes, and snippets.

@ianmariano
Created December 4, 2014 05:35
Show Gist options
  • Select an option

  • Save ianmariano/4174c51bb161ef9546b8 to your computer and use it in GitHub Desktop.

Select an option

Save ianmariano/4174c51bb161ef9546b8 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

Comments are disabled for this gist.