A random seed (or seed state, or just seed) is a
number
A number is a mathematical object used to count, measure, and label. The most basic examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with number words. More universally, individual numbers can ...
(or
vector) used to
initialize a
pseudorandom number generator
A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), is an algorithm for generating a sequence of numbers whose properties approximate the properties of sequences of random number generation, random n ...
.
A pseudorandom number generator's number sequence is completely determined by the seed: thus, if a pseudorandom number generator is later reinitialized with the same seed, it will produce the same sequence of numbers.
For a seed to be used in a pseudorandom number generator, it does not need to be random. Because of the nature of number generating algorithms, so long as the original seed is ignored, the rest of the values that the algorithm generates will follow
probability distribution
In probability theory and statistics, a probability distribution is a Function (mathematics), function that gives the probabilities of occurrence of possible events for an Experiment (probability theory), experiment. It is a mathematical descri ...
in a pseudorandom manner. However, a non-random seed will be cryptographically insecure, as it can allow an adversary to predict the pseudorandom numbers generated.
The choice of a good random seed is crucial in the field of
computer security
Computer security (also cybersecurity, digital security, or information technology (IT) security) is a subdiscipline within the field of information security. It consists of the protection of computer software, systems and computer network, n ...
. When a secret
encryption
In Cryptography law, cryptography, encryption (more specifically, Code, encoding) is the process of transforming information in a way that, ideally, only authorized parties can decode. This process converts the original representation of the inf ...
key is
pseudorandomly
generated, having the seed will allow one to obtain the key. High
entropy
Entropy is a scientific concept, most commonly associated with states of disorder, randomness, or uncertainty. The term and the concept are used in diverse fields, from classical thermodynamics, where it was first recognized, to the micros ...
is important for selecting good random seed data.
Random seeds need to be chosen carefully in order to ensure random number generation. If a seed is chosen that doesn't provide actual random results, the numbers given by the
PRNG (pseudo random number generator) will not work properly in an application that needs them. Charting the output values of a PRNG with a
scatter plot is a good way to find out if the seed is working. If the graph shows static, then the PRNG is giving random results, but if a pattern appears, the seed needs to be fixed.
If the same ''random'' seed is deliberately shared, it becomes a
secret key, so two or more systems using matching pseudorandom number algorithms and matching seeds can generate matching sequences of non-repeating numbers which can be used to synchronize remote systems, such as
GPS satellites and receivers.
Random seeds are often generated from the state of the computer system (such as the
time
Time is the continuous progression of existence that occurs in an apparently irreversible process, irreversible succession from the past, through the present, and into the future. It is a component quantity of various measurements used to sequ ...
), a
cryptographically secure pseudorandom number generator or from a
hardware random number generator.
See also
*
Salt (cryptography)
*
Pseudorandomness
*
Cryptographic nonce
*
Initialization vector
*
/dev/random
References
Random seed
{{Comp-sci-theory-stub