15 ms·
No, you don’t need specialized hardware. The output of a modern hash for crypto absolutely needs to produce a uniform distribution across a million.
by kortilla 3y ago
No, you don’t need specialized hardware. The output of a modern hash for crypto absolutely needs to produce a uniform distribution across a million.
- monsieurbanana 3y agoBut how do you pick the input for the hash?
- danbruc 3y agoCurrent date and time.
- coldtea 3y agoJust bang away at the full keyboard for 50-100 characters?
- speedgoose 3y agoYou need a seed, and a previous hash. The seed is usually sourced from another random generator, that uses environmental noise and some (salted) hashing as well. In practice, a precise clock and a few difficult to guess events like keyboard and mouse inputs are enough to get a descent seed.
- p51ngh 3y agoDo you mean, after picking a million numbers, then every number in the range should have been picked exactly once?
- jbstack 3y agoDefinitely not this. That wouldn't be random at all. For example, after picking 999,999 numbers you would be able to predict the next number with certainty. What it means is that every time you select a number, every number in the range has an equal probability of being selected.
- dtgriscom 3y agoWhich means that there must be more state in the generator than is output as a random number; otherwise each time number X was produced then number Y would follow it. (Perhaps obvious, but I like stating the obvious.)
- kortilla 3y agoNo, each number has a 1 in a 1,000,000 chance each time the generator is used.
- Tainnor 3y agoThat's not a uniform distribution. Probability doesn't remember previous state, so the chance of picking the number 241 out of 1 million numbers remains exactly the same after picking 241 once. In particular, the chance of getting no duplicate numbers if you pick a million times, is very close to zero.
- Tainnor 3y agoTechnically, it's not actually uniform, or "random" - it only has to be indistinguishable from random, e.g. if you had access to a true random source and a pseudo-random one, it should be computationally infeasible to distinguish them.
- nine_k 3y agoGiven a finite amount of sample.values, you can always find a polynomial to match the values. You can only proclaim that something is "truly random" on epistemological grounds, assuming that true randomness is somehow exposed by the universe. This holds under quantum physics, but not under classical mechanics. Unless there is some quantum effect, RNGs based on fluid dynamics, like lava lamps, may be completely deterministic, we just don't know how to set their initial conditions precisely enough.to reproduce a phase trajectory.
- adrianN 3y agoYour polynomial has no predictive value in almost all cases.
- nine_k 3y agoYes. Finding out the nature of a PRNG and its initial state would allow one to predict next values, at least theoretically, that is, if it can be computed faster than the values are generated by the process we're looking at. But the presence or absence of such a function for a naturally occurring process is, again, an epistemological question. That is, whether we can reverse-engineer the universe deeply enough. Unless we find its source code, we're stuck with retrofitting some formulas, and a "random process" is such for which we can't retrofit any better description than a statistical one.
- Tainnor 3y agoYou're right that we can never find conclusive empirical evidence for something being truly random, but we can say with confidence that a PRNG is not random because we can look at the algorithm.