Just for fun, I wrote a little shell script that generates pseudo-random passwords along the lines hinted at above. The features are:
* Uses
/dev/random by default, or
/dev/urandom with the
-u flag.
* Passwords can be from 1 to 63 characters long.
* The characters come from a set of 64 ASCII characters, uniformly distributed (assuming output from
/dev/[u]random is so).
* The use of entropy is quite efficient in that every 3 bytes read from
/dev/[u]random can generate 4 characters. This is done by saving unused bits and reassembling them.
Code:
$ randpw.sh
Usage> randpw.sh [-u] LENGTH
LENGTH : Length of password (1,...,63)
-u : Use /dev/urandom (default: /dev/random)
Code:
$ randpw.sh -u 10
%_9EL^;PO[
It seems to work on
sh,
ksh,
bash. Suggestions, etc., welcome.
randpw.sh.gz