Skip to content Skip to sidebar Skip to footer

Random Number Generator Matlab Same Number Over and Over Again

Computers generate random number for everything from cryptography to video games and gambling. There are ii categories of random numbers — "true" random numbers and pseudorandom numbers — and the difference is important for the security of encryption systems.

Computers can generate truly random numbers by observing some exterior data, similar mouse movements or fan noise, which is not predictable, and creating information from it. This is known equally entropy. Other times, they generate "pseudorandom" numbers by using an algorithm so the results appear random, even though they aren't.

This topic has become more than controversial recently, with many people questioning whether Intel'south built-in hardware random number generator chip is trustworthy. To sympathize why it might not be trustworthy, you'll have to understand how random numbers are generated in the first place, and what they're used for.

What Random Numbers Are Used For

Random numbers have been used for many thousands of years. Whether it's flipping a coin or rolling a dice, the goal is to go out the end upshot up to random chance. Random number generators in a computer are similar — they're an attempt to achieve an unpredictable, random result.

RELATED: What Is Encryption, and How Does Information technology Work?

Random number generators are useful for many unlike purposes. Bated from obvious applications like generating random numbers for the purposes of gambling or creating unpredictable results in a figurer game, randomness is of import for cryptography.

Cryptography requires numbers that attackers can't guess. We can't just employ the same numbers over and over. We want to generate these numbers in a very unpredictable way so attackers can't gauge them. These random numbers are essential for secure encryption, whether you're encrypting your own files or only using an HTTPS website on the Internet.

True Random Numbers

You may be wondering how a calculator can actually generate a random number. Where does this "randomness" come from. If it's but a piece of computer lawmaking, isn't information technology possible the numbers the computer generates could be anticipated?

We generally group the random numbers computers generate into two types, depending on how they're generated: "True" random numbers and pseudo-random numbers.

To generate a "true" random number, the reckoner measures some blazon of concrete miracle that takes place outside of the calculator. For case, the computer could measure the radioactive decay of an atom. According to quantum theory, there'south no way to know for sure when radioactive decay will occur, so this is essentially "pure randomness" from the universe. An attacker wouldn't be able to predict when radioactivity would occur, so they wouldn't know the random value.

For a more day-to-24-hour interval case, the computer could rely on atmospheric dissonance or simply use the exact fourth dimension you lot press keys on your keyboard equally a source of unpredictable data, or entropy. For example, your computer might notice that you lot pressed a key at exactly 0.23423523 seconds after two p.m.. Grab enough of the specific times associated with these key presses and you'll have a source of entropy you can use to generate a "truthful" random number. You lot're non a predictable motorcar, so an attacker can't guess the precise moment when you press these keys. The /dev/random device on Linux, which generates random numbers, "blocks" and doesn't return a upshot until information technology gathers enough entropy to return a truly random number.

Pseudorandom Numbers

Pseudorandom numbers are an culling to "true" random numbers. A computer could use a seed value and an algorithm to generate numbers that appear to be random, simply that are in fact predictable. The figurer doesn't gather whatever random data from the environs.

This isn't necessarily a bad matter in every state of affairs. For example, if you lot're playing a video game, it doesn't really matter whether the events that occur in that game are acquired by "true" random numbers or pseudorandom numbers. On the other hand, if you're using encryption, you don't desire to use pseudorandom numbers that an attacker could judge.

For instance, permit'southward say an attacker knows the algorithm and seed value a pseudorandom number generator uses. And let's say an encryption algorithm gets a pseudorandom number from this algorithm and uses it to generate an encryption cardinal without adding any additional randomness. If an attacker knows plenty, they could piece of work backwards and decide the pseudorandom number the encryption algorithm must have chosen in that case, breaking the encryption.

The NSA and Intel's Hardware Random Number Generator

To make things easier for developers and aid generate secure random numbers, Intel chips include a hardware-based random number generator known equally RdRand. This bit uses an entropy source on the processor and provides random numbers to software when the software requests them.

The trouble here is that the random number generator is essentially a black box and we don't know what's going on inside it. If RdRand contained an NSA backdoor, the government would be able to pause encryption keys that were generated with only data supplied by that random number generator.

This is a serious concern. In Dec 2013, FreeBSD's developers removed support for using RdRand directly as a source of randomness, maxim they couldn't trust it. [Source] The output of the RdRand device would exist fed into another algorithm that adds additional entropy, ensuring that whatever backdoors in the random number generator wouldn't thing. Linux already worked in this way, farther randomizing the random information coming from RdRand then that information technology wouldn't exist predictable even if there was a backdoor. [Source] In a recent AMA ("Ask Me Annihilation") on Reddit, Intel CEO Brian Krzanich did not answer questions about these concerns. [Source]

Of course, this likely isn't just a trouble with Intel fries. FreeBSD's developers called out Via'southward fries by name, also. This controversy shows why generating random numbers that are truly random and aren't predictable is and then of import.


To generate "true" random numbers, random number generators get together "entropy," or seemingly random data from the concrete world around them. For random numbers that don't really need to be random, they may just use an algorithm and a seed value.

Prototype Credit: rekre89 on Flickr, Lisa Brewster on Flickr, Ryan Somma on Flickr, huangjiahui on Flickr

dillardwhave1961.blogspot.com

Source: https://www.howtogeek.com/183051/htg-explains-how-computers-generate-random-numbers/

Post a Comment for "Random Number Generator Matlab Same Number Over and Over Again"