# Generating a Mnemonic

Krux has support for creating 12 and 24-word mnemonic seed phrases. Since true entropy is difficult to produce, especially with an embedded device, we recommend to outsource entropy generation using dice rolls, but it is also possible to use camera as a source of entropy to quickly create a mnemonic.
At the start screen, once you select `New Mnemonic`

, you will be taken to a second menu where you can choose to create a mnemonic via camera, via rolls of a D6 (standard six-sided die) or D20 (20-sided die).

## Camera¶

(Experimental!) Choose between 12 or 24 words, then take a random picture and Krux will generate a mnemonic from the hash of the image bytes.

## Dice Rolls¶

### Via D6¶

Choose between 12 or 24 words.

The entropy in a single roll of a D6 is 2.585 bits ( log_{2}(6) ); therefore a minimum of a 50 rolls will be required for 128 bits of entropy, enough to generate a 12-word mnemonic. For 24 words, or an entropy of 256 bits, a minimum of 99 rolls will be required.

### Via D20¶

Since a D20 has more possible outcomes, the entropy is increased per roll to 4.322 bits ( log_{2}(20) ). This means that only 30 rolls are necessary to create a 12-word mnemonic and 60 rolls for a 24-word mnemonic.

### How it works¶

For dice rolls, Krux keeps track of every roll you enter and displays the cumulative string of outcomes after each roll.

When you have entered your final roll, Krux will hash this string using SHA256 and output the resulting hash to the screen so that you can verify it for yourself.

In the case a camera snapshot is used as source, image bytes, which contain pixels data in RGB565 format, will be hashed just like it is done with the dice rolls string.

Krux then takes this hash, runs `unhexlify`

on it to encode it as bytes, and deterministically converts it into a mnemonic according to the BIP-39 Reference Implementation.

Note: For 12-word mnemonics, only the first half of the SHA256 hash is used (128 bits), while 24-word mnemonics use the full hash (256 bits).

## Alternatives¶

See here for good methods to generate a mnemonic manually, or visit Ian Coleman's BIP-39 Tool offline or on an airgapped device to generate one automatically.

It's worth noting that Ian's tool is able to take a mnemonic and generate a QR code that Krux can read in via the QR input method mentioned on the next page.