Bitcoin Forum
December 11, 2016, 10:25:33 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Managing and protecting my wallets  (Read 685 times)
jamoes
Member
**
Offline Offline

Activity: 89


View Profile
June 12, 2011, 01:51:22 PM
 #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 = <<EOF
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?
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481451933
Hero Member
*
Offline Offline

Posts: 1481451933

View Profile Personal Message (Offline)

Ignore
1481451933
Reply with quote  #2

1481451933
Report to moderator
Ruudsy
Newbie
*
Offline Offline

Activity: 19


View Profile
June 13, 2011, 01:18:43 PM
 #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?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!