Hacker News new | past | comments | ask | show | jobs | submit login

How bad is the randomness here? Totally predictable? Predictable if you don't have an external entropy source (e.g. a hardware RNG)? Predictable if you don't have user input (e.g. keyboard typing etc)?



I'm not an expert, but it looks to me like if randomdev_init_reader isn't called then read_random will use dummy_random_read_phony which in turn calls random(9), a linear congruential generator.

http://fxr.watson.org/fxr/source/dev/random/randomdev.c?im=3...


If it does use a LCG, then it is totally broken from a cryptographic standpoint: http://security.stackexchange.com/q/4268


Why doesn't this cause a crash? Compatibility?


There are some places early in the kernel boot where "random" numbers are needed but they don't need to be truly unpredictable. A similar approach is used for time: If part of the kernel boot process looks at the clock but we don't have a real clock running yet, just return the values "0", "1", "2", etc. as the time since what really matters is that they are monotonically increasing.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: