I had my phone erased, due to my own mistake. So I needed to get my wallet running again on my phone from a backup I created. Well when I went to import it, I could not for the life of me get the correct password. I tired for over an hour.
So after reading a few of the posts here and some from the bitcoind forum I modified a ruby script created by Revalin to work with openssl and look for the correct header record as specified here:
https://raw.githubusercontent.com/schildbach/bitcoin-wallet/master/wallet/README.recoverThe ruby code works well enough, it is for the newer (v3.47+) wallets, but can be quickly modified for older ones. It does create some files in the system directory based on the password you put in the script. Likely due to the ">" in the charters var. I am sure someone more knowledgeable in ruby could fix it up proper. It was my first time I have used that language, and it solved my issue.
Anyway I didn't see anything specific for this type of wallet, so I thought I would share. Hope this helps someone some day.
#!/usr/bin/ruby -w
# Put your best guess in passphrase
passphrase = "oops"
characters = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
def test(phrase)
print phrase, "\t"
msg=`openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2014-12-06 -k #{phrase} |tr -cd "[:print:]" | awk '{print $1}'`
msg = msg.chomp
if msg == "org.bitcoin.production"
puts "Found it! #{phrase}"
exit 0
end
end
# transpose adjacent chars
(passphrase.length - 1).times do |i|
testphrase = passphrase.dup
testphrase[i] = passphrase[i+1]
testphrase[i+1] = passphrase[i]
test testphrase
end
# delete one char
passphrase.length.times do |i|
testphrase = passphrase.dup
testphrase = testphrase[0,i] + testphrase[(i+1)..-1]
test testphrase
end
# substitutute one char
passphrase.length.times do |i|
characters.chars.each do |c|
testphrase = passphrase.dup
testphrase[i] = c
test testphrase
end
end
# insert one char
(passphrase.length + 1).times do |i|
characters.chars.each do |c|
testphrase = passphrase.dup
testphrase.insert(i, c)
test testphrase
end
end
puts "No luck."
exit 1