The security model of password generation in dicendo

The examples in this section assume two typical configurations. When only dice faces are used, we assume 36 ordinary (unnumbered) dice. When faces, directions, and order are all used, we assume 12 numbered dice. These values are used only for illustration.

In practice, dicendo makes no assumptions about the number of dice or the number of recorded inputs. The counts of faces, directions, and order values may differ, and the method works for any combination of these inputs.

A simplified but fully functional implementation of the algorithm is available as a short Python script. For identical inputs it produces exactly the same outputs as the application, making it possible to independently verify the algorithm. The working simplified implementation can be found here: Python script.

1. Faces (dice values)

Passwords generated by dicendo are based on physical randomness obtained from dice rolls. If only face values are used (i.e., orientation and order are not used), the process can be viewed as generating a random number in base 6, where the number of rolls n corresponds to the number of digits.

This random base-6 number can then be deterministically converted into a number represented in another base equal to the size of the selected output alphabet. The value therefore remains random, only its representation changes, forming the generated password.

When using only dice faces, approximately 30 rolls are needed to obtain a good-quality 12-character password. This corresponds to about 630 ≈ 2 * 1023 possible outcomes. For comparison, 12 dice faces alone correspond to 612 ≈ 2 * 109 possible outcomes.

2. Directions (dice orientation)

If the orientation of each die is also recorded, every die provides an additional random value from the set {N, E, S, W}, which can be interpreted as a digit in base 4. For n dice this produces a random number in base 4 with n digits (for 12 dice, this gives about 412 ≈ 1.6 * 107 possible outcomes).

As with face values, this number can be deterministically converted into another representation without affecting its randomness.

3. Order (permutation of dice)

When permutations are used, the situation is similar. If the dice are numbered and their order is recorded, every permutation of the n dice is equally probable. In total there are n! possible permutations, each occurring with the same probability. The set of permutations can therefore be indexed: every permutation corresponds to a unique integer in the range 0 ... (n! − 1).

A well-known method for computing such an index is the Lehmer code. This algorithm assigns a unique integer to each permutation.

Because the dice order is generated randomly, the resulting index is also a random number. This value can therefore be used as entropy and deterministically converted into a representation in the selected output alphabet.

Permutations provide a large amount of entropy even for relatively small values of n. For example, 12! possible orders correspond to approximately 5 * 108 equally likely outcomes.

4. Combining the entropy sources

In practice the three sources of entropy are processed independently. For example, when using 12 dice we obtain three numbers: n from the dice faces, d from the directions, and o from the permutation index.

These values are combined into a single integer using a mixed-radix encoding:

p = 612 * 412 * o + 412 * n + d

The resulting number p uniquely represents the combined dice outcome.

More generally, the same construction works for arbitrary numbers of inputs. Let in denote the number of face values, id the number of recorded directions, and io the number of dice used in the permutation. The combined value can then be written as:

p = 6i_n * 4i_d * o + 4i_d * n + d

Here n is the number obtained from dice faces, d from directions, and o is the index of the permutation. The permutation length io determines the range of o, which takes values from 0 … (io! − 1).

5. Converting the number into the final password

The number p is finally converted into a representation in the selected output alphabet, producing the generated password.

When faces, directions, and order are all used, a good-quality password can be obtained with only about 12 dice rolls, because the total number of possible states is approximately 612 × 412 × 12! ≈ 1.7 × 1025.

In practical terms, this means that adding directions and order significantly increases the amount of entropy obtained from each roll. Faces, directions, and order provide three independent entropy sources, which both allow strong passwords to be generated with fewer dice and reduce the risk that possible bias from imperfect dice or non-uniform rolling techniques could affect the final result.


Back to documentation