Sunday, May 15, 2011

My preferred way to backup a bitcoin wallet

I encrypt it and email it to myself. In the email, I put decryption instructions (minus the passphrase, of course)

What I wanted was cross-platform decryption instructions, so that in a pinch, I could get my wallet from anywhere (Mac, PC (with cygwin) or Linux) and use it.

Here's what I've come up with, courtesy of lifehacker.

WARNING: If you haven't done this before, you should probably have a read through here first to get an idea of what exactly it is your backing up.

Then, shutdown your bitcoin client, and make a copy the wallet.dat and place it in a new, working folder.

Let's take the MD5 hash now, before we mess with it

> md5sum wallet.dat
f802a7fa2c7119cf15385b282443eb0f wallet.dat

Now, think of a passphrase, and encrypt.

> openssl des3 -salt -in wallet.dat -out wallet.dat.des-ede3-cbc

enter des-ede3-cbc encryption password:

Now rename the wallet.dat file to a backup before decrypting:

mv wallet.dat wallet.dat.orig

And decrypt:

> openssl des3 -d -salt -in wallet.dat.des-ede3-cbc -out wallet.dat

enter des-ede3-cbc encryption password:

Finally, check the MD5 of the newly decrypted wallet.dat:

> md5sum wallet.dat
f802a7fa2c7119cf15385b282443eb0f wallet.dat

No comments:

Post a Comment