Diving Into Randomness
So I’m working on messing with the Linux Pseudo-Random-Number-Generator. I read the Wikipedia article on /dev/random and /dev/urandom and tried it out with a little code that I wrote to read a byte at a time and increment a counter which it then printed to the screen. I noticed that when reading from /dev/random, it only spit out data in eight-byte increments. I couldn’t figure it out till I read the Wikipedia article closer and realized that it seems to wait intelligently for sufficient entropy before generating data. In other words, I think that it blocks and makes sure that the bytes given wil be cryptographically safe before giving them.
Contrast that with /dev/urandom which spits out bytes as fast as they can be read….neat huh?















No comments yet.