I'd like to generate some random passwords using Emacs, and thus need a secure random number generator. I don't like that 'random
might be seeded from system time
I'd feel most comfortable just reading from /dev/urandom
:
(insert-file-contents-literally "/dev/urandom" nil 0 32)
Unfortunately Emacs complains with insert-file-contents-literally: not a regular file: /dev/urandom
Is there another way of reading from urandom
or generating secure numbers?
EDIT: Looking at the source of 'random
, I see that it's using libc rand()
, which is another notch against using 'random
for passwords (see this question)