Author

Topic: Tutorial: Creating a bulletproof 255-bit entropy Armory wallet (Read 992 times)

hero member
Activity: 547
Merit: 500
Decor in numeris
Quote
(The reason I use a deck of cards in addition to a die is to guard against potential bias in the die.)

Just roll the dice a few more times :-)

An honest die provides log2(6) bits of entropy, that is 2.58 bits.

A pretty biased one, where the odds of getting 6 is twice that of any other number (2/7 versus 1/7 for the five other possibilities) gives you
S = - SUM_i p_i log2 p_i = - ( (2/7) log2(2/7) + (5/7) log2(1/7) = 2.26 bits

Not much less, and that is a pretty biased die.  If you roll your die 100 times, you get 226 bits of entropy; more than enough since the work of breaking the discrete logarithm problem with a 256 bit key is only 128 bits.  But you could just roll it 113 times instead.

TL;DR: Even a biased die is an excellent source of randomness.
pf
full member
Activity: 176
Merit: 105
They say Armory pretty much guarantees a 256-bit entropy when creating wallets. I'm skeptical:

  • The machine's random number generation hardware could have been tampered with.
  • This is why the Linux kernel adds extra entropy on top of that. But unless you compiled your Ubuntu from source code, you cannot be sure that your Ubuntu random number generation hasn't been tampered with.

Armory adds its own entropy on top of those (and on top of the Crypto++ library it uses), such as mouse cursor location, hashes of system files, and screenshots. I'm still skeptical:

  • Someone could figure out one day that the way human beings place their mouse cursor on the screen is not very random.
  • Hashes of system files may not be all that random, especially on a fresh offline Ubuntu install.
  • Screenshots may not be very random either, especially on a fresh offline Ubuntu install meant only for Armory.

I'm not saying that all of these things will not provide a 256-bit entropy. I'm just skeptical. That's all I'm saying.

This is why I have decided, just as a precautionary measure, to add in extra entropy from both a 6-sided die and a deck of 52 cards using the following steps. They pretty much guarantee a 255-bit entropy. Very similar steps have been analyzed in more detail on this thread of mine. (The reason I use a deck of cards in addition to a die is to guard against potential bias in the die.) The nice thing about these steps is that you're just using the default Armory program that you are already using. You aren't doing anything crazy that you could screw up; at worst, you won't do any harm. Here are the steps:

  • Compile Armory from source code and get it onto your offline Ubuntu machine. In my case, that's Ubuntu 14.04 LTS. This tutorial of mine shows you how to do this. Note: These steps were tested with Armory 0.93.2.
  • Install the statistical software R on your offline computer. This tutorial of mine explains how.
  • Buy a 6-sided die.
  • Roll your die a hundred times and record the results (i.e., hundred numbers from 1 to 6) into your offline computer. I suggest using the built-in "Text Editor" (gedit) in Ubuntu. Remember: Do not expose these results to an online computer.
  • Use R on your offline computer to test whether these results show evidence of bias in your die. This tutorial of mine explains how.
  • If you find evidence of bias, go back to step 3. Otherwise, continue. (Of course, keep in mind that your die could still be biased, which is why we also use a deck of cards.)
  • On your offline computer, use python ArmoryQt.py to run the Armory that you have compiled.
  • In Armory, click "Create Wallet" to enter the "Wallet Creation Wizard" window.
  • Arrange things such that both the "Wallet Creation Wizard" window and your hundred numbers are visible on the screen.
  • Divide your screen real estate into any 6 areas you like and label them from 1 to 6. One simple way is to divide it into three columns and two rows and label the rectangles of the first row with 1,2,3 and those of the second row with 4,5,6. Remember these areas and their corresponding 1-6 numbers.
  • Click the mouse cursor on the "Wallet description" text field to bring focus to it.
  • Pick the first of your hundred numbers.
  • Place your mouse cursor somewhere into the corresponding screen area. For example, if the number is 3, place your mouse cursor somewhere in area 3.
  • Type some character, any character at all, into the "Wallet description" text field, without moving the mouse cursor. This records the cursor location into the entropy.
  • Repeat the previous two steps another 99 times for the rest of your numbers.
  • Now we move on to the deck of cards.
  • Buy a deck of 52 cards.
  • On your online computer, download an image showing all 52 cards in a deck. You'll find one on Google Images. Using a USB key, get this image onto your offline computer.
  • Open up the image on your offline computer and place it beside the Armory program. Make sure you can see all of the cards and are able to type into the "Wallet description" text field. If there isn't enough room on your screen, try zooming out the image or going back to the previous step for a smaller image.
  • Use your mouse to bring focus back to the "Wallet description" text field in Armory.
  • Shuffle your deck of cards as you normally would shuffle them before a regular card game.
  • Use your imagination to further mix up the cards real good.
  • Arrange your cards into a neat stack of randomly ordered 52 cards.
  • Pick the top card from the stack and put the card aside. (Don't put it back into the stack.)
  • Place your mouse cursor on one of the 52 cards on the image that corresponds to the real card you picked.
  • Type some character into the "Wallet description" text field, without moving the mouse cursor.
  • Repeat the previous three steps another 51 times until your stack is exhausted.
  • Repeat the previous seven steps one more time. Reason: A single deck of cards will not provide a full 255-bit entropy, but a bit less.
  • You are now done. You have recorded a boatload of entropy into Armory.
  • Proceed with creating your Armory wallet as usual.

See also my other tutorials (that have been linked to above where applicable).
Tutorial: Installing R on an offline Ubuntu computer
Tutorial: Using R to statistically test a die for bias
Tutorial: Compiling Armory and getting it onto an offline computer
Jump to: