News for hackers. Stuff that matters.
Re:Myths about /dev/urandom (2014) by citrin_ru on Thursday January 05, 2017 @08:27PM (#13333169)
Or better use getentropy(2)/getrandom(2) when it is possible.
Re:Myths about /dev/urandom (2014) by eddieh on Thursday January 05, 2017 @08:49PM (#13333262)
arc4random and arc4random_buf are probably better still.
Re:Myths about /dev/urandom (2014) by nshepperd on Thursday January 05, 2017 @09:17PM (#13333390)
Please don't use arc4random* for cryptographic purposes. RC4 is broken -- there are practical attacks against it. It's fine for non-secure purposes though (eg. monte carlo simulation).
Re:Myths about /dev/urandom (2014) by eddieh on Thursday January 05, 2017 @10:11PM (#13333609)
The 'arc4' no longer refers to RC4 on macOS/iOS and OpenBSD. On those systems 'arc4random' is playfully a bacronym for "A Replacement Call for Random". The new arc4random* implementation will now be replaced as cryptographic techniques advance.

It appears the Apple and OpenBSD implementations use the getentropy syscall and then add additional entropy mixing.

Re:Myths about /dev/urandom (2014) by gbrown_ on Friday January 06, 2017 @04:53AM (#13335104)
Yup, OpenBSD have even changed calls to other entropy sources to returning strong random by default from arc4random.

http://marc.info/?l=openbsd-cvs&m=141807513728073&w=2

Re:Myths about /dev/urandom (2014) by arthur2e5 on Friday January 06, 2017 @10:10AM (#13336809)
Re:Myths about /dev/urandom (2014) by tossedaway334 on Thursday January 05, 2017 @09:37PM (#13333469)
arc4random uses chacha20 on openBSD now, has for several years, OSX and FreeBSD are yet to update...
Re:Myths about /dev/urandom (2014) by eddieh on Thursday January 05, 2017 @09:44PM (#13333504)
The macOS Sierra man page says it uses the NIST-approved AES cipher and will be replaced as the techniques advance.
Re:Myths about /dev/urandom (2014) by JoshTriplett on Thursday January 05, 2017 @08:31PM (#13333193)
True, but never pass GRND_RANDOM or GRND_NONBLOCK.
Re:Myths about /dev/urandom (2014) by Gaelan on Friday January 06, 2017 @01:56AM (#13334479)
NONBLOCK just returns an error code instead of blocking. No harm in that, AFIAK.
Re:Myths about /dev/urandom (2014) by marcosdumay on Friday January 06, 2017 @09:35AM (#13336434)
Just wait until people start using the EAGAIN value in keys.
Re:Myths about /dev/urandom (2014) by zrm on Friday January 06, 2017 @12:01AM (#13334094)
Why do these flags exist if they should never be used?
Re:Myths about /dev/urandom (2014) by marcosdumay on Friday January 06, 2017 @09:37AM (#13336450)
There are probably good uses for them.

But unless you are doing something very tightly integrated with Linux, you should just ignore them.