Skip to content

Instantly share code, notes, and snippets.

@katcaola
Last active June 5, 2018 19:14
Show Gist options
  • Save katcaola/8ade25b84911513791b7aaaadc8c1b1c to your computer and use it in GitHub Desktop.
Save katcaola/8ade25b84911513791b7aaaadc8c1b1c to your computer and use it in GitHub Desktop.
echo 'some-password' | mkpasswd --stdin --method=sha-512 --salt="$(tr -dc '[:alnum:]' </dev/urandom | head -c16)"
# What is this?
# Get 16 teaspoons of salt
$ od -tx1 -N15 -An </dev/urandom | tr -dc '[:xdigit:]'
# >16 is too many
echo 'some-password' | mkpasswd --stdin --method=sha-512 --salt="$(tr -dc '[:alnum:]' </dev/urandom)"
Wrong salt length: 32 bytes when 8 <= n <= 16 expected.
# Mix well with hashed browns
echo 'hashed browns' | mkpasswd --stdin --method='sha-512' --salt='<PASTE OUTPUT FROM OD HERE>'
# Notes:
# Go to the grocery store and get 1 lb of mkpasswd
sudo apt-get install whois
# Because
$ dpkg -S $(command -v mkpasswd)
whois: /usr/bin/mkpasswd
@rethink-neil
Copy link

Yay!

We should probably move everything to gitlab.

@katcaola
Copy link
Author

katcaola commented Jun 5, 2018

#someday....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment