password generator
password generator
openssl
openssl rand -hex 32python
xkcd style:
python -c 'import secrets;import string;f=open("/usr/share/dict/words");words=[word.strip().title() for word in f];digits=string.digits;password = "-".join(secrets.choice(words) for i in range(4)) + "_" + "".join(secrets.choice(digits) for i in range(3));print(password)'random:
python -c 'import secrets;print(secrets.token_hex(32))'if you want to pipe this into something like pbcopy to have it directly in your clipboard, do something like this to avoid a newline:
echo -n $(python -c 'import secrets;import string;f=open("/usr/share/dict/words");words=[word.strip().title() for word in f];digits=string.digits;password = "-".join(secrets.choice(words) for i in range(4)) + "_" + "".join(secrets.choice(digits) for i in range(3));print(password)') | pbcopyyou might want to check the official python docs.
gpg
gpg --gen-random --armor 2 30/dev/urandom
LC_ALL=C tr -cd '[:graph:]' < /dev/urandom | head -c23others
- pwgen