Created
October 29, 2013 11:08
-
-
Save typhonius/7212680 to your computer and use it in GitHub Desktop.
Super simple password hashing on the command line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SALT=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-10};echo;` | |
PW=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-18};echo;` | |
HASH=`openssl passwd -1 -salt $SALT $PW` | |
echo "Automatically generated password of $PW salted against $SALT gets hashed as $HASH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment