Last active
January 25, 2018 00:05
-
-
Save syntaxerrormmm/4f3e5b5605bf1ed0bf15f1f6e638a23c to your computer and use it in GitHub Desktop.
This file contains 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 | |
generate_random() { | |
RANDOM_NUMBER=`/usr/bin/perl -e 'print int(rand(60453));'` | |
} | |
gen_password() { | |
generate_random | |
randomWord1=`head -$RANDOM_NUMBER ./dizionario.txt | tail -1` | |
generate_random | |
randomWord2=`head -$RANDOM_NUMBER ./dizionario.txt | tail -1` | |
echo "${randomWord1}-${randomWord2}" | |
} | |
numpass=$1; shift | |
for ((i=1;i<=${numpass};i++)); do | |
gen_password | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
bash password_generator.sh 500
To obtain 500 lines of new passwords.
dizionario.txt
may be any list of words. For example, in italian, you may choose any of the files you may found here.