True random like coin toss.

Pseudoramdom like generated by a computer program.

Unpredictabale

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

mouse chase

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 6^{6}, or 46656, possible cominations. A single roll of
three dice has 6^{3}, or 216, possible combinations; and two separate
rolls 432 combinations.

Swap Pattern | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

"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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

Sum Occurances | 1 | 3 | 6 | 10 | 15 | 21 | 25 | 27 | 27 | 25 | 21 | 15 | 10 | 6 | 3 | 1 |

"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.

NIST SP800-90 with enough throws entropy increases enough for unpredicatibly requirements SHA based PRNG to remove bias.

52 in binary is 110100, by removing 4 cards we get 48 which in binary is 110000. That is six bits long but would leave unused gaps, introducing bias. Staying with 4 bits means less cards drawn for a given ammount of entropy then dice throws.

As cards are drawn, randomness decreases because drawing that card again is impossible untill the next suffle. Unpredicabilty does not decrease. During a card game cards are exposed where the opponent can see them. However, using cards for entropy the object is not to let opponent see wants going on. Randomness can be restored by reshuffling at random time. The kings are not used, so I suggest doing a reshuffle everytime a king is drawn. After experimenting with that method I found that with all four kings in the deck, I was doing a LOT of reshuffling. Removing two or three kings from the deck on average I'd get half way through the deck before a king appeared.

Details, getting four bits.

52 - 4 kings = 48

Four suits can be two bits

48 / 4 = 12

if we let three cards be the same binary value

12 / 3 = 4

4 is another two bits

Suit for Upper 2 bits | |||

Diamond | 0000 | ||

Spade | 0100 | ||

Heart | 1000 | ||

Club | 1100 | ||

Logical OR with card value for lower 2 bits |
|||

A | 5 | 9 | 0000 |

2 | 6 | 10 | 0001 |

3 | 7 | J | 0010 |

4 | 8 | Q | 0011 |

Gives 4 bits per card. |