True random like coin toss.
Pseudoramdom like generated by a computer program.
Randomness versus Unpredictability
The only reasonable way for servers/unatended is Hardware True Random Number Generator.
Practical random for seeds will ideas for using what the computer has and human
input without specialized hardware,
low bits of time
Coin toss is unpredictable and random (each toss 50-50). But would be VERY slow because 1 bit at time.see example in en.wikipedia.org/wiki/Entropy_(information_theory)#Definition for strick definition.
While perfect regards randomness, the number of tosses even for a seed is rediculous.
Dice are unpredictable, but randomness decreases as the number of dice used increases. A roll of one die is completely random; that is, the probability of any value occuring is equal to that of the other possibilities. Two dice are much less random. The lowest result, two, and the highest result, twelve, are six times less likely to occur than seven, with probability of the other possible results falling in between. The spread of probabilities for three dice are worse. A result of ten or eleven is twentyseven times more likely than three or twelve. Dispite this I will use rolling three dice as a way to generate random seed values. For additional information see en.wikipedia.org/wiki/Dice#Probability
With three dice the possible values are three to eighteen. That is sixteen possibilities. Sixteen possible states can be represented exactly with four bits, and four bits is very convenient for building bytes. It would be even more convenient if randomness could be improved without the need for additional rolls. The graph to the right shows the probability for "a" roll of three dice. If for "another" roll the actual sum is swapped for another sum with the "opposite" probability, then the bias will be cancelled out across the two rolls. For example, if a three is rolled then it is recorded as a ten, or if an eight is rolled then it is recorded as a five. Do not confuse this with two rolls and taking the overall sum. That would be the equivalent of six dice, with 66, or 46656, possible cominations. A single roll of three dice has 63, or 216, possible combinations; and two separate rolls 432 combinations.
|"As Rolled" 3 Dice Sums||3||4||5||6||7||8||9||10||11||12||13||14||15||16||17||18|
|"Swapped" 3 Dice Sums||10||9||8||7||6||5||4||3||18||17||16||15||14||13||12||11|
|Sum of 3 Dice||3||4||5||6||7||8||9||10||11||12||13||14||15||16||17||18|
|"Swapped" Sum Occurances||27||25||21||15||10||6||3||1||1||3||6||10||15||21||25||27|
|2 Roll Occurance Sum||28||28||27||25||25||27||28||28||28||28||27||25||25||27||28||28|
Of course, if the four bits of a roll and the four bits of a "swapped" roll, where always combined to make a byte the same way, then the the resulting bytes would be biased. A way to cure this is with one random bit per roll to determine if "as rolled" or "swapped" values will be used. The time to shake the dice, roll, and enter the result is in the tens of seconds. Whether the number of milliseconds when result entered is odd or even is random enough; and saves additional effort by the user.
|Suit for Upper 2 bits|
|Logical OR with
card value for
lower 2 bits
|Gives 4 bits per card.|