Created
August 4, 2017 03:15
-
-
Save milleniumbug/4059b7a713346e02305bc828f271fa17 to your computer and use it in GitHub Desktop.
Generate a passphrase from a dictionary file (like /usr/share/dict/english)
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 | |
if [ $# -lt 2 ]; then | |
echo "Usage: passphrasegen.sh path-to-dictionary number-of-words" | |
exit 1 | |
fi | |
# TOFIX: the actual number of possible passwords is not N^M, but N*(N-1)*(N-2)*...*(N-M+1) | |
shuf -n "$2" "$1" --random-source /dev/urandom | paste -d\ --serial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment