4 ms·
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 ha
by richardwhiuk 12y ago
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)?
- bradleyjg 12y agoI'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#L221 http://fxr.watson.org/fxr/source/dev/random/randomdev.c?im=3...
- ReidZB 12y agoIf it does use a LCG, then it is totally broken from a cryptographic standpoint: http://security.stackexchange.com/q/4268 http://security.stackexchange.com/q/4268
- mintplant 12y agoWhy doesn't this cause a crash? Compatibility?
- cperciva 12y agoThere 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.