Skip to content

Instantly share code, notes, and snippets.

@zuzkins
Last active February 11, 2016 18:38
Show Gist options
  • Save zuzkins/cad0c1a62ba5c257ca16 to your computer and use it in GitHub Desktop.
Save zuzkins/cad0c1a62ba5c257ca16 to your computer and use it in GitHub Desktop.
wrapper which hashes given password with sha512 and 150k iterations and random salt. The result is suited to be used with glibc crypt function (htpasswd files) on systems, which do not have blowfish patch in glibc (eg. ubuntu)
#! /bin/bash
mkpasswd -m sha-512 -R 150000 -s -S $(openssl rand -hex 32 | cut -b 1-16)
@zuzkins
Copy link
Author

zuzkins commented Feb 11, 2016

usage:

$ echo "password" | ./hash-pwd.sh
$6$rounds=150000$4b7c3af43fa9c7ef$hCfiqldh06dTZZrfoqWXF.tqXak25uZr22/7nzLah7vDsI8QrFXwSbksUthCX9vbJOCsSkEpS5Y9sz2E8x8ib1

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