-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-10-22 08:25, Michal Kubecek wrote:
On Mon, Oct 21, 2013 at 04:22:33PM +0200, Carlos E. R. wrote:
What is exactly a short read? It is an unknown concept to me.
See the read(2) man page:
On success, the number of bytes read is returned (zero indicates end of file), and the file position is advanced by this number. It is not an error if this number is smaller than the number of bytes requested; this may happen for example because fewer bytes are actually available right now (maybe because we were close to end-of-file, or because we are reading from a pipe, or from a terminal), or because read() was interrupted by a signal.
Thanks! Now I understand the phrase "short read". Yes, I knew the concept (now I see the description), since many years, but not the name given to it.
With /dev/random, the number of bytes available depends on how much entropy has been gathered. You can monitor it via
/proc/sys/kernel/random/entropy_avail
but even checking in advance doesn't guarantee they will still be available for read() as someone else might read from /dev/random in the meantime. The only reliable way is to repeat the reads until you have the needed amount. If you don't want to wait, you can either use /dev/urandom (if you don't mind worse randomness) or get a hardware generator.
Perhaps there is a list of things that increase entropy that users can do. Typical is moving or switching windows. Maybe having a tuner, listening to all network packets, watching a video... - -- Cheers / Saludos, Carlos E. R. (from 12.3 x86_64 "Dartmouth" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJmRzgACgkQtTMYHG2NR9WPdACeOZizppOLpFvpmPFf2pwowG+U m/IAnjMjqDbYzJ0Lig4ZhT8ssx/8dHbY =T5Zi -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org