Skip to content

Instantly share code, notes, and snippets.

@syntaxerrormmm
Last active January 25, 2018 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syntaxerrormmm/4f3e5b5605bf1ed0bf15f1f6e638a23c to your computer and use it in GitHub Desktop.
Save syntaxerrormmm/4f3e5b5605bf1ed0bf15f1f6e638a23c to your computer and use it in GitHub Desktop.
#!/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
@syntaxerrormmm
Copy link
Author

syntaxerrormmm commented Jan 25, 2018

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.

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