[RFC] Support for /dev/urandom in kdelibs
Michael Buesch
mbuesch at freenet.de
Mon Dec 27 17:49:30 GMT 2004
Quoting Ingo Klöcker <kloecker at kde.org>:
> > int fd = open("/dev/urandom", O_RDONLY);
> > // Why only read the seed from /dev/urandom and not directly
> > // the random data itself?
>
> Because truly random bytes are extremely expensive and you'd run out of
> random bytes very quickly. You'll notice this when you try to generate
> an OpenPGP key just after starting your computer. Most likely gpg will
> use up all random bytes and ask you to play with the mouse and the
> keyboard so that some more entropy can be gathered.
No. That's the reason why we have /dev/urandom and /dev/random.
/dev/urandom does not run out of random bytes. If the entropy pool
in the kernel shrinks below a predefined level, pseudo random data
(which is as good as random data in that case) is emitted.
> There could of course be an additional method
> KApplication::trulyRandomButVeryExpensiveSoDontUseUnlessYouHaveVeryGoodReasons().
>
> Regards,
> Ingo
>
--
Regards Michael Buesch [ http://www.tuxsoft.de.vu ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20041227/a7bfbb87/attachment.sig>
More information about the kde-core-devel
mailing list