O'Reilly logo

Mastering UNIX® Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus, Second Edition by Randal K. Michael

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required