diceware icon indicating copy to clipboard operation
diceware copied to clipboard

Reduce entropy loss when num of dice and length of wordlist do not fit

Open ulif opened this issue 8 years ago • 0 comments

When we have dice with n sides and use a wordlist of m words, then we would like to get an optimum entropy of log(m) per word. If, however, m is not a power of n, then, I think, we lose entropy when mapping dice throws to the words in the wordlist.

Consider n=3 and m=2:

1  →  A
2  →  B
3  →  ?

What to do when the user rolls a "3"?

Two possibilities come to mind:

a) 1 → A 2 → B 3 → A

b) 1 → A 2 → B 3 → deny, roll again, until one of (1, 2) is rolled

The second one (b) is, what we implement currenty. But is this mathematically the best?

ulif avatar Sep 12 '17 13:09 ulif