3 ms·
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 b
by garethrees 8y 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
- mistaken 8y agoAlso `openssl rand -hex 16` works pretty well :)