Bitcoin Forum
June 30, 2024, 05:49:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Re: Encrypted wallet.dat, lost password, any solutions? on: January 11, 2014, 05:22:28 PM
edit: i added some random word in the initial password and it did the same thing, said found it! but of course it was the wrong password. It seems to think the first guess is the right one.

That's strange.  Try running this script and paste the output into this thread.

Code:
#!/usr/bin/ruby
require "open3"
$electrum = 'C:\Users\Admin\Desktop\Brute\electrum-1.9.5.exe'
i,o,t = Open3.popen2e($electrum, "-o", "getseed")
i.puts "wrong-password"
i.close
puts o.read.inspect
puts t.value.inspect

Ran from the command prompt:

C:\Documents and Settings\Administrator\Desktop\Brute>tryagain.rb
"Error: Wallet file not found.\nType 'electrum create' to create a new wallet, o
r provide a path to a wallet with the -w option\n"
#<Process::Status: pid 712 exit 0>

Wallet, electrum, and script all in same folder.

i tried adding the -w flag in different ways pointing to the wallet file but it kept throwing syntax errors.
2  Bitcoin / Bitcoin Technical Support / Re: Encrypted wallet.dat, lost password, any solutions? on: December 29, 2013, 04:00:17 PM
Rather than giving your whole wallet over to someone, just extract one keypair, preferably one for an address with 0 balance.  They can then crack it, but won't have access to all of your funds when they succeed.

I just need a working script and i can do it myself, is OP going to come back?
3  Bitcoin / Bitcoin Technical Support / Re: Encrypted wallet.dat, lost password, any solutions? on: December 28, 2013, 12:07:30 AM
I ran it from the command prompt, it gave me a password instantly and said it found it but its not the right one, i tried to send coin to myself and electrum said it was invalid.

edit: i added some random word in the initial password and it did the same thing, said found it! but of course it was the wrong password. It seems to think the first guess is the right one.

edit2: for the record im running windows 7x64 + electrum standalone 1.9.5 + ruby 1.9.3.

edit3: this is the script im using

Code:
#!/usr/bin/ruby
require 'base64'
require 'digest/sha2'
require 'open3'
require 'openssl'

# Double substitution for Electrum

# Put your best guess at your passphrase here
passphrase = '****************'

# The full path to your electrum.dat or default_wallet
wallet_file = 'C:\Users\Admin\Desktop\Brute\wallet.dat'

# Where to find Electrum.  Use 1.9.2!  Older versions may be incompatible.
$electrum = 'C:\Users\Admin\Desktop\Brute\electrum-1.9.5.exe'


def test(phrase)
  $cipher.reset
  $cipher.key = Digest::SHA256.digest(Digest::SHA256.digest(phrase))
  $cipher.update $seed
  $cipher.final
  puts phrase
  i,o,t = Open3.popen2e($electrum, "-o", "getseed")
  i.puts(phrase)
  i.close
  if t.value.success?
    puts "Found it! #{phrase}"
    exit
  end
rescue OpenSSL::Cipher::CipherError
end

def scramble(passphrase)
  characters = " !$'(),.ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz"
  list = []

  # transpose adjacent chars
  (passphrase.length - 1).times do |i|
    testphrase = passphrase.dup
    testphrase[i] = passphrase[i+1]
    testphrase[i+1] = passphrase[i]
    list << testphrase
  end

  # delete one char
  passphrase.length.times do |i|
    testphrase = passphrase.dup
    testphrase = testphrase[0,i] + testphrase[(i+1)..-1]
    list << testphrase
  end

  # substitutute one char
  passphrase.length.times do |i|
    characters.chars.each do |c|
      testphrase = passphrase.dup
      testphrase[i] = c
      list << testphrase
    end
  end

  # insert one char
  (passphrase.length + 1).times do |i|
    characters.chars.each do |c|
      testphrase = passphrase.dup
      testphrase.insert(i, c)
      list << testphrase
    end
  end

  return list.uniq
end

wallet = File.read(wallet_file)
seed_base64 = wallet.match(/'seed': '([^']+)'/).captures.first
$seed = Base64.decode64(seed_base64)
$cipher = OpenSSL::Cipher.new('aes-256-cbc')
$cipher.iv = $seed.slice!(0,16)
Dir.chdir File.dirname $electrum
list1 = scramble(passphrase)
list1.each { |i| test i }
list1.each { |i| scramble(i).each { |j| test j }}
puts "No luck."
exit 1
4  Bitcoin / Bitcoin Technical Support / Re: Encrypted wallet.dat, lost password, any solutions? on: December 27, 2013, 09:26:47 PM
Hi revalin i had an old electrum wallet that i forgot about a while ago and went back recently to get the coins out of it but it wouldnt work even though i saved the password i used, but i think i might have changed it slightly and didnt save the changes or something but i know what it generally is and what characters i used. I found your electrum script and installed ruby on win7 and modified it to point to the wallet and electrum.exe and named it brute.rb but when i ran it it just opened and closed. i dont know what else to do can you please help?
5  Other / Beginners & Help / Re: CannibalCoin: A Method for Destroying Fiat Currency on: December 25, 2013, 02:00:55 AM
Theres an altcoin called friecoin that destroys itself a little if no one uses it called friecoin. i dont see the point of pegging a coin to fiat though as it would give the fed control of the currencies value, though it would be closer to a digital 'cash' if you did.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!