Skip to content

Generate Passwords

Some quick ways to generate random passwords:

OpenPGP - 18 bytes, base 64 encoded (24 chars after encoding):

Bash Session
$ gpg --gen-random -a 0 18
InH7FdaOvylS5bKH8udyp92I

OpenSSL - 18 bytes, base 64 encoded:

Bash Session
$ openssl rand -base64 18
qdTYUSPonKHvfyPIse/3wIUy

PERL - 16 printable chars:

Bash Session
$ perl -le 'print map { ("a".."z", "A".."Z", 0..9)[rand 62] } 1..16'
sZwx1Vi6qUEPrapZ

In a pinch, try this:

Bash Session
$ date | md5sum | awk '{print $1}' | base64
NGM1YjQxODlhMmQzMjY2NjhjZDE3YTIxNDk1MTY1NjEK

APG - Random passwords:

Bash Session
$ apg -m 16 -a 1 -n 1
h,Y*_!F{y)mB;j"q

APG - Pronouncable passwords:

Bash Session
$ apg -m 16 [-a 0] -n 1
ubyujhasThekchog