top | item 19336614

(no title)

garethrees | 7 years ago

This one-line shell script is a bit simpler:

    base64 /dev/urandom | head -c 16
(Vary the number of characters according to the desired entropy: you get 6 bits of entropy for each character of output, so 16*6 = 96 bits in the example. Use /dev/random or /dev/arandom if you prefer those random sources.)

For passphrases, use GNU shuf (from the coreutils package):

    shuf -n 4 --random-source=/dev/urandom /usr/share/dict/words

discuss

order

mistaken|7 years ago

Also `openssl rand -hex 16` works pretty well :)