Author

Topic: Managing and protecting my wallets (Read 925 times)

newbie
Activity: 19
Merit: 0
June 13, 2011, 08:18:43 AM
#2
on my win7 mashine i use a strange combination of the taskplanner, cobian backup and truecrypt. the taskplanner will start an stop the bitcoin exe, cobian backup puts the wallet.dat into a filecontainer created by truecrypt. this container is copied to a server by cobian backup.
its not too strange ;-) isnt it?
member
Activity: 89
Merit: 10
June 12, 2011, 08:51:22 AM
#1
So, I was trying to participate in this thread: http://forum.bitcoin.org/index.php?topic=15068.0, and I couldn't find the reply button. After a few minutes, I realized I was relegated to this ghetto. So, I figured I'd post what I was going to post here.

Here's the ruby script I use to backup my wallet.dat file

Code:
require 'rubygems'
require 'zip/zip'  # http://rubyzip.sourceforge.net/

now = Time.now

wallet_location = '~/Library/Application Support/Bitcoin/wallet.dat'
backup_folder = '~/backups/bitcoin'

puts "Please ensure the Bitcoin client is not running"
print "Wallet name: "
wallet_name = gets.strip

backup_zip = "wallet-backup_#{wallet_name}_#{now.strftime('%Y-%m-%d')}_#{now.to_i}.zip"
backup_wallet = "wallet.dat.#{now.strftime('%Y-%m-%d')}.#{wallet_name}.aes-256-cbc"

md5 = `md5 -l -n #{wallet_location}`.strip

`openssl aes-256-cbc -a -salt -in #{wallet_location} -out #{backup_folder}/#{backup_wallet}`


info = <Wallet MD5: #{md5}
Wallet Name: #{wallet_name}

Decryption command:
openssl aes-256-cbc -d -a -salt -in #{backup_wallet} -out wallet.dat
EOF

zip = Zip::ZipFile.open("#{backup_folder}/#{backup_zip}", true)
zip.get_output_stream(backup_wallet) { |f| f.puts(File.read("#{backup_folder}/#{backup_wallet}")) }
zip.get_output_stream('info.txt') { |f| f.puts(info) }
zip.close

File.delete("#{backup_folder}/#{backup_wallet}")

This script is based on a bash backup script found here: https://github.com/mrkva/BitcoinBackup.sh/blob/master/BitcoinBackup.sh I prefer ruby though, so I re-wrote it.

This script encrypts and backs up my wallet. It includes instructions of how to decrypt it, and an md5 hash of the decrypted wallet for verification purposes. After running the script, I upload the wallet to gmail and save it to a backup disk. I also verify that I can fully decrypt and access the wallet by decrypting it on a different computer with a fresh install of bitcoins.

What processes to others use to manage their wallet backups?
Jump to: