I have looked through StackExchange sites, Google, Wikipedia, and all the other usual sources and have been unable to find a good answer to my question.
"Does the size in bits matter when seeding a pseudo-random number generator?
I understand that, in many or most cases, time is used as the seed value but the explanations give for why this is so all deal with it being a useful method of getting a constantly changing seed value. Size does not seem to be an issue.
I am starting to dig into some crypto related issues and this has piqued my curiosity. As a layman, it would seem that the numbers generated could be easily reproduced through brute force if using, for example, an integer between 1 and 100 as the seed. I have seen 0 and 1 used quite often. Even with time as a random see, it might be brute forced if the starting time could be closely monitored. But brute forcing a random 256 bit number would be pretty tough.
Am I correct or is there some mechanism unknown to me that makes this a non-issue?
I will not even pretend to be more than a end-user of others work in this area and understand that my question may be naive. Yet it is something I do not understand and would appreciate some help.
I am currently working on a project in python 3.x (which is also pretty new to me) so tagged the question with that string but the question is really more generic than a particular languages implementation (I think).
The PRNG should be very fast. The application should spend its time running the actual algorithms, not generating random numbers. PRNG output should have robust statistical qualities. Bits should appear to be independent and the output should closely follow the desired distribution.
The seed() method is used to initialize the random number generator. The random number generator needs a number to start with (a seed value), to be able to generate a random number. By default the random number generator uses the current system time.
Calling a PRNG in the same initial state, either without seeding it explicitly or by seeding it with a constant value, results in generating the same sequence of random numbers in different runs of the program.
The PRNG can be seeded from a file, directly from memory, or, if you are using Microsoft Windows, from the pixels on the screen. NOTE: The more unpredictable the seed, the better.
The size of the seed is important at least in the sense that it is ideally equal to the state length of the PRNG. Although seeds that have been used in common practice are 32 or 64 bits long, such seeds are generally appropriate only if the underlying PRNG's state length is 32 or 64 bits, respectively. Many modern PRNGs have longer state lengths, though. (In general, the greater the variety of seeds, the greater the variety of random number sequences a PRNG can generate.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With