Add passhprase generator

This commit is contained in:
Shav Kinderlehrer 2024-03-01 19:51:00 -05:00
parent b0d5301b90
commit 8f099d14af
2 changed files with 18 additions and 0 deletions

1
.gitignore vendored Normal file → Executable file
View File

@ -76,3 +76,4 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux # End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux
words.txt

17
passphrase.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
WORDLIST_URL='https://www.mit.edu/~ecprice/wordlist.10000'
PASS_LEN=6
if [ ! -f words.txt ]; then
curl "$WORDLIST_URL" > words.txt
fi
for i in {1..$1}; do
for word in $(cat words.txt | sort -R | head -n $((PASS_LEN-1))); do
printf "%s-" "$word"
done
printf "%s\n" $(cat words.txt | sort -R | head -n1)
done