More Examples (Password Generation): Use POSIX tools instead of pwgen

This better melds with the spirit of the talk since it shows users how to
repurpose existing tools rather than use a specialized one.
master
Mike Gerwitz 2019-03-17 21:21:59 -04:00
parent 0f9b1ddf16
commit cc7dc5d288
Signed by: mikegerwitz
GPG Key ID: 8C917B7F5DC51BA2
1 changed files with 5 additions and 4 deletions

View File

@ -2734,8 +2734,8 @@ Both examples produce a new set of images prefixed with =sm-=.
#+BEGIN_SRC
# generate a random 32-character password
$ pwgen -ysn1 32
!Wd\%Hhg5j-{c2GY(p1Y}TkQJM#{1LUA
$ tr -cd '[:graph:]' < /dev/urandom | head -c32
`TB~cmJQ1%S8&tJ,%FoD54}"Fm4}\Iwi
# generate passphrase from EFF's large dice wordlist
# (https://www.eff.org/dice)
@ -2753,8 +2753,9 @@ oppressor roman jigsaw unhappy thinning grievance
:END:
How about password generation?
=pwgen= is a tool that can generate passwords of various forms.
Here we generate a random 32-character password.
=/dev/urandom= consists of random binary data.
We can use =tr= to delete everything that is not a printable character by
taking the complement of =graph=.
That type of password is useful if you have a password manager,
but it's not useful if you need to memorize it.