CHAPTER11

Pseudo-Random Number and Data Generation

When we enter the realm of randomness, we head straight for the highest level of mathematical complexity and outright conflict between researchers. This conflict revolves around the following question:

Can a computer create a true random number?

If you believe some experts, you are living in dreamland if you think a computer can create a true random number. However, we are going to study several ways to produce pseudo-random numbers. Some of these techniques are able to create numbers that are suitable for encryption keys and for cryptographic secure communication links, and some are not.

What Makes a Random Number?

It is very difficult, if not impossible, to create a true random number in a computer system. The problem is, at some level, repeatability and predictability of the number. When you start researching random numbers you quickly enter the realm of heavy mathematical theory, and many of the researchers have varying opinions of randomness. I will leave this discussion to university professors and professional statisticians. The only true random numbers that I know of, in my limited research, are the frequency variations of radioactive decay events and the frequency variations of white noise. Radioactive decay events would have to be detected in some way, and because we do not want to have any radioactive material hanging around we can use built-in computer programs called pseudo-random number generators, and even query ...

Get Mastering UNIX® Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.