News for hackers. Stuff that matters.
Re:Linux /dev/urandom and concurrency by mike-cardwell on Friday April 18, 2014 @04:20PM (#7611095)
Ah. You appear to be right. I'm glad I asked now.

[edit] I'm going to skip using the Mersenne twister engine and just use std::random_device for all random data, instead of as a seed. It seems on Linux at least that random_device is basically /dev/urandom. I assume the source will be sane on other OS's too.

Re:Linux /dev/urandom and concurrency by pbsd on Friday April 18, 2014 @05:46PM (#7611509)
The C++ standard gives little guarantees for the quality of std::random_device. As I remember, MinGW on Windows uses the Mersenne Twister with a hardcoded seed for it.

boost::random_device, on the other hand, has better guarantees: it is only implemented where there's a decent entropy source.

Re:Linux /dev/urandom and concurrency by mike-cardwell on Friday April 18, 2014 @06:28PM (#7611662)
Thanks for the info. Seeing as I'm already using boost, that sounds very useful.
Re:Linux /dev/urandom and concurrency by ekimekim on Friday April 18, 2014 @05:42PM (#7611498)
Please don't do this. This exact approach is what caused the problems described in the article.

If you need secure random numbers, do what you had above (though in light of other comments, perhaps consider a different algo besides MT).

Re:Linux /dev/urandom and concurrency by tptacek on Friday April 18, 2014 @05:51PM (#7611530)
This is a recommendation that says that a developer should actually consider using the Mersenne Twister for secure random numbers to avoid a potential performance problem.