Bitcoin Forum
May 02, 2024, 11:09:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Other / Off-topic / Re: decryption wallet.dat on: September 28, 2020, 07:46:00 PM
I'll take your password-protected wallet.dat file for decryption
I inform you right away, I DO NOT BUY vallets !!!
If you have a vallet to which you forgot the password, I’ll try to decrypt it!
After decryption, I return you 25-50% of the contents of the wallet (depends on the contents and time-costs)
It is very welcome if you know at least something about the password, it greatly speeds up the process.
I also take corrupted wallet.dat files
Only Bitcoin, I do not take other files.
Don't write silly questions
Write to the PM.


I have 3 encrypted wallet; could you please help me to recover password.
Wallet: 1
Bitcoin Address:    19peh1TwMaV8AS3jsUcahyBCHEo5eymtdn    Balance: 0.03166236 Bitcoin
Bitcoin Address:    1Ax7V6ypcNCgmXSvD6fySCx33u3LkiLq11    Balance: 0.00120380 Bitcoin

Wallet: 2
Bitcoin Address:    1F654t1HxrZtg7uhcXyZeFvRsyB8HCnBXJ    Balance: 1.08 Bitcoin

Wallet: 3
Bitcoin Address:    1N8L17Z7D6bBCWkSKABDf2qqJNHT1R9fv7    Balance: 2.2 Bitcoin

If you able to decrypt i will give you one by one.....
2  Bitcoin / Project Development / Re: [Release][Source] BitcoinLottery (Bitcoin Brute Force Cracking Tool in Java) on: September 28, 2020, 06:40:33 PM
Hi Bitcointalk!
I'm not good at java and crypto algorithms, but I wanted to check how the author's code works and in addition .EXE the file looks suspicious.
Maybe because I'm not so lazy, sorry about that.

I didn't change anything in the original code just added (System.out.println) the output of some information to the console, that's all, becauce I want to see what the values genereting code.

Source:
Code:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.security.Security;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Random;
import java.util.Scanner;

import org.spongycastle.asn1.sec.SECNamedCurves;
import org.spongycastle.asn1.x9.X9ECParameters;
import org.spongycastle.crypto.digests.RIPEMD160Digest;
import org.spongycastle.crypto.params.ECDomainParameters;
import org.spongycastle.math.ec.ECPoint;

public class BitcoinLottery {
private static File BitcoinAddressen = new File("./Addys.txt");
private static String genPrivateKey;
private static BigInteger privateKeyNumber;
private static byte[] publicKey;
private static String genAddy;
private static final ECDomainParameters EC_PARAMS;
private static final BigInteger BASE58_CHUNK_MOD = BigInteger.valueOf(0x5fa8624c7fba400L);
private static final int BASE58_CHUNK_DIGITS = 10;
private static final char[] BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray();
     private static int Counter = 0;

//Generate Curve for Eliptic Curve Algo:
static {
       X9ECParameters params = SECNamedCurves.getByName("secp256k1");
       EC_PARAMS = new ECDomainParameters(params.getCurve(), params.getG(), params.getN(), params.getH());
   }

     public static void main(String[] args) throws FileNotFoundException {
       System.out.println("Let`s start!!!");
     while(true) {
     System.out.println("Iteration no: " + Counter);
       Counter = Counter + 1;
     Scanner AddressStream = new Scanner(BitcoinAddressen);
    
     //Generate new privatekey and convert it to hex
     privateKeyNumber = new BigInteger(256, new Random()); //random generation
     System.out.println("Private Key Number: " + privateKeyNumber);
     //Generate PublicKey to calculate Address from:
     ECPoint uncompressed = EC_PARAMS.getG().multiply(privateKeyNumber);
     publicKey = uncompressed.getEncoded(false);
     System.out.println("Public Key: " + publicKey);
    
        
     //Generate Bitcoin-Address:
     try {
             byte[] hashedPublicKey = sha256ripemd160(publicKey);
             byte[] addressBytes = new byte[1 + hashedPublicKey.length + 4];
             addressBytes[0] = (byte) (0);
             System.arraycopy(hashedPublicKey, 0, addressBytes, 1, hashedPublicKey.length);
             MessageDigest digestSha = MessageDigest.getInstance("SHA-256");
             digestSha.update(addressBytes, 0, addressBytes.length - 4);
             byte[] check = digestSha.digest(digestSha.digest());
             System.arraycopy(check, 0, addressBytes, hashedPublicKey.length + 1, 4);
             genAddy = encodeBase58(addressBytes);
             System.out.println("Gen Bitcoin-Address: " + genAddy);
         }
     catch (NoSuchAlgorithmException e) {
         }
    
     //Check if Address is in our List:
     while(AddressStream.hasNextLine()){
     if(AddressStream.nextLine().equals(genAddy)){
     System.out.println("!!!!SUCCESS!!!!");
       //Convert PrivateKey to Wallet Input Format:
       genPrivateKey = privateKeyNumber.toString(16);
             System.out.println("Convert PK to Wallet: " + genPrivateKey);
       genPrivateKey = "80"+genPrivateKey;
             System.out.println("Convert PK to Wallet +80 (magic): " + genPrivateKey);
       try {
MessageDigest digestSha = MessageDigest.getInstance("SHA-256");
byte[] hash = digestSha.digest(genPrivateKey.getBytes(StandardCharsets.UTF_8));
hash = digestSha.digest(hash);
String checksum = "";

for(int i=1; i < 5; i++) {
 checksum = checksum + hash[i];
}

genPrivateKey = genPrivateKey + checksum;
genPrivateKey = encodeBase58(genPrivateKey.getBytes(StandardCharsets.UTF_8));
System.out.println("Final Private Key: " + genPrivateKey);
writeStuffToFile();
} catch (NoSuchAlgorithmException e) {
writeStuffToFile();
}
      
     }
      }
     AddressStream.close();  
     }
   }
    
     public static void writeStuffToFile() {
     try {
        String Info = "Private Key: "+ privateKeyNumber + " HEX: " + privateKeyNumber.toString(16) + " WIF: "+ genPrivateKey;
        Files.write(Paths.get("PrivateKeys.txt"), Info.getBytes(), StandardOpenOption.APPEND);
     }catch (IOException e) {
     System.out.println("KEY FOUND BUT THERE WAS A PROBLEM WRITING TO FILE!:");
        System.out.println("Private Key: "+ privateKeyNumber + " HEX: " + privateKeyNumber.toString(16));
        System.out.println("WIF: "+ genPrivateKey);
        System.out.println();
     }
     }
     public static String encodeBase58(byte[] input) {
         if (input == null) {
             return null;
         }
         StringBuilder str = new StringBuilder((input.length * 350) / 256 + 1);
         BigInteger bn = new BigInteger(1, input);
         long rem;
         while (true) {
             BigInteger[] divideAndRemainder = bn.divideAndRemainder(BASE58_CHUNK_MOD);
             bn = divideAndRemainder[0];
             rem = divideAndRemainder[1].longValue();
             if (bn.compareTo(BigInteger.ZERO) == 0) {
                 break;
             }
             for (int i = 0; i < BASE58_CHUNK_DIGITS; i++) {
                 str.append(BASE58[(int) (rem % 58)]);
                 rem /= 58;
             }
         }
         while (rem != 0) {
             str.append(BASE58[(int) (rem % 58)]);
             rem /= 58;
         }
         str.reverse();
         int nLeadingZeros = 0;
         while (nLeadingZeros < input.length && input[nLeadingZeros] == 0) {
             str.insert(0, BASE58[0]);
             nLeadingZeros++;
         }
         return str.toString();
     }
  
     public static byte[] sha256ripemd160(byte[] publicKey) {
         try {
             MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
             byte[] sha256hash = sha256.digest(publicKey);
             RIPEMD160Digest ripemd160Digest = new RIPEMD160Digest();
             ripemd160Digest.update(sha256hash, 0, sha256hash.length);
             byte[] hashedPublicKey = new byte[20];
             ripemd160Digest.doFinal(hashedPublicKey, 0);
             return hashedPublicKey;
         } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException(e);
         }
     }
}

How I tried to set up (Windows OS):
  - compile the Source
    -- downloaded and installed JDK
    -- downloaded Spongy Castle and copied jar(s) to the ..\Java\jdk1.8.0\jre\lib\ext\ directory
    -- created folder BitcoinLottery (on desktop for example) containing 2 files within "BitcoinLottery.java" and "Manifest.txt", into the "BitcoinLottery.java" file pasted code from top, into the "Manifest.txt" pasted
Code:
Main-class: BitcoinLottery
   -- started cmd.exe and tried run command:
Code:
javac C:\Users\USER_NAME\Desktop\BitcoinLottery\BitcoinLottery.java
   -- run next command:
Code:
jar cfvm C:\Users\USER_NAME\Desktop\BitcoinLottery\BitcoinLottery.jar C:\Users\USER_NAME\Desktop\BitcoinLottery\Manifest.txt C:\Users\USER_NAME\Desktop\BitcoinLottery\BitcoinLottery.class
   -- created empty text file called "PrivateKeys.txt", download list with the addresses for crack and name it "Addys.txt" and saved both into the BitcoinLottery folder
    -- run the last commnad into console: java -jar C:\Users\USER_NAME\Desktop\BitcoinLottery\BitcoinLottery.jar


If everythings all right you could see something like that:


I don't know is that correctly works, i mean methods and algorithms, but generation values happen.
It somehow works.


Note:
  - The zip file blelow does contain all components for start. Before run "BitcoinLottery.jar" in console, computer need to has JRE


Download: https://sundryfiles.com/3wg

References:
http://www.bouncycastle.org/documentation.html
Tutorial on how to make a Java JAR file with the command prompt

P.S.: I'm not native English speaker and hope you'll not have any problems with reading and running.



Hi,
I was converted the BitcoinLottery.java to BitcoinLottery.py as bellow. It was found some error massage; somebody help to modify for working accurately.


#!/usr/bin/env python
""" generated source for module HelloWorld """
from __future__ import print_function
class BitcoinLottery(object):
    """ generated source for class BitcoinLottery """
    BitcoinAddressen = File("Addys.txt")
    genPrivateKey = None
    privateKeyNumber = None
    publicKey = []
    genAddy = None
    EC_PARAMS = None
    BASE58_CHUNK_MOD = BigInteger.valueOf(0x5fa8624c7fba400L)
    BASE58_CHUNK_DIGITS = 10
    BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray()

    #  private static int Counter = 0;
    # Generate Curve for Eliptic Curve Algo:
    params = SECNamedCurves.getByName("secp256k1")

    @classmethod
    def main(cls, args):
        """ generated source for method main """
        while True:
            # print("Iteration no:" + Counter);
            AddressStream = Scanner(cls.BitcoinAddressen)
            # Generate new privatekey and convert it to hex
            cls.privateKeyNumber = BigInteger(256, Random())
            # random generation
            # Generate PublicKey to calculate Address from:
            uncompressed = cls.EC_PARAMS.getG().multiply(cls.privateKeyNumber)
            cls.publicKey = uncompressed.getEncoded(False)
            # Generate Bitcoin-Address:
            try:
                hashedPublicKey = sha256ripemd160(cls.publicKey)
                addressBytes = [None] * 4 + len(hashedPublicKey)
                addressBytes[0] = int((0))
                System.arraycopy(hashedPublicKey, 0, addressBytes, 1, )
                digestSha = MessageDigest.getInstance("SHA-256")
                digestSha.update(addressBytes, 0, len(addressBytes))
                check = digestSha.digest(digestSha.digest())
                System.arraycopy(check, 0, addressBytes, len(hashedPublicKey), 4)
                cls.genAddy = encodeBase58(addressBytes)
            except NoSuchAlgorithmException as e:
                pass
            # Check if Address is in our List:
            while AddressStream.hasNextLine():
                if AddressStream.nextLine() == cls.genAddy:
                    print("!!!!SUCCESS!!!!")
                    # Convert PrivateKey to Wallet Input Format:
                    cls.genPrivateKey = cls.privateKeyNumber.toString(16)
                    cls.genPrivateKey = "80" + cls.genPrivateKey
                    try:
                        digestSha = MessageDigest.getInstance("SHA-256")
                        hash = digestSha.digest(cls.genPrivateKey.getBytes(StandardCharsets.UTF_8))
                        hash = digestSha.digest(hash)
                        checksum = ""
                        i = 1
                        while i < 5:
                            checksum = checksum + hash
                            i += 1
                        cls.genPrivateKey = cls.genPrivateKey + checksum
                        cls.genPrivateKey = encodeBase58(cls.genPrivateKey.getBytes(StandardCharsets.UTF_8))
                        writeStuffToFile()
                    except NoSuchAlgorithmException as e:
                        writeStuffToFile()
            AddressStream.close()

    @classmethod
    def writeStuffToFile(cls):
        """ generated source for method writeStuffToFile """
        try:
            Info = "Private Key: " + cls.privateKeyNumber + " HEX: " + cls.privateKeyNumber.toString(16) + " WIF: " + cls.genPrivateKey
            Files.write(Paths.get("PrivateKeys.txt"), Info.getBytes(), StandardOpenOption.APPEND)
        except IOError as e:
            print("KEY FOUND BUT THERE WAS A PROBLEM WRITING TO FILE!:")
            print("Private Key: " + cls.privateKeyNumber + " HEX: " + cls.privateKeyNumber.toString(16))
            print("WIF: " + cls.genPrivateKey)
            print()

    @classmethod
    def encodeBase58(cls, input):
        """ generated source for method encodeBase58 """
        if input == None:
            return None
        str_ = StringBuilder((len(input)) / 256 + 1)
        bn = BigInteger(1, input)
        rem = long()
        while True:
            divideAndRemainder = bn.divideAndRemainder(cls.BASE58_CHUNK_MOD)
            bn = divideAndRemainder[0]
            rem = divideAndRemainder[1].longValue()
            if bn.compareTo(BigInteger.ZERO) == 0:
                break
            i = 0
            while i < cls.BASE58_CHUNK_DIGITS:
                str_.append(cls.BASE58[int((rem % 58))])
                rem /= 58
                i += 1
        while rem != 0:
            str_.append(cls.BASE58[int((rem % 58))])
            rem /= 58
        str_.reverse()
        nLeadingZeros = 0
        while input[nLeadingZeros] == 0 and len(input):
            str_.insert(0, cls.BASE58[0])
            nLeadingZeros += 1
        return str_.__str__()

    @classmethod
    def sha256ripemd160(cls, publicKey):
        """ generated source for method sha256ripemd160 """
        try:
            sha256 = MessageDigest.getInstance("SHA-256")
            sha256hash = sha256.digest(publicKey)
            ripemd160Digest = RIPEMD160Digest()
            ripemd160Digest.update(sha256hash, 0, )
            hashedPublicKey = [None] * 20
            ripemd160Digest.doFinal(hashedPublicKey, 0)
            return hashedPublicKey
        except NoSuchAlgorithmException as e:
            raise RuntimeException(e)
3  Other / Beginners & Help / Re: GPU brute forcing an encrypted wallet on: August 23, 2020, 04:15:56 PM
I lost my password to a wallet that had 20 bitcoins in it, its now worth my effort to retrieve it. I tried using Revalins script found here https://bitcointalk.org/index.php?topic=85495.msg942171#msg942171 without any luck.

So I have modified it to brute force based off a base password that I know is correct, so I'm only have to brute force between 6-8 characters which is feasible.

Code:
#!/usr/bin/ruby -w
class Cracker
  def initialize(char_array, password_range)
    @char_array = char_array
    @password_range = password_range
  end

  def password_correct?(phrase)
    print "basepassword" + phrase, "\t"
    system("./bitcoind walletpassphrase basepassword#{phrase} 20")
    case $?.exitstatus
    when 0
      puts "Found it!  basepassword#{phrase}"
      exit 0
    end
    return false
  end

  def generate_password( perm_number, password_length )
    password=""
    (1..password_length).each do |char_number| # loop through characters
      char_reference = (perm_number / @char_array.length**(char_number-1)).floor % @char_array.length
      character = @char_array[char_reference]
      password << character
    end
    password
  end

  def do_combination( num_combinations, password_length )
    (0..num_combinations-1).each do |perm_number| # loop through combinations for a given length
      password = generate_password( perm_number, password_length )
      return password, perm_number if password_correct?(password)
    end
  end

  def crack()
    (@password_range).each do |password_length|  # loop to gradually increase password length
      num_combinations=@char_array.length**password_length
      password, perm_number = do_combination(num_combinations, password_length)
      if password
        puts "#{password} | Access Granted | #{perm_number} / #{num_combinations}"
        return password
      end
    end
  end
end

# I removed characters I was sure I didn't use
characters = "!$@01235@ABCDEFGIKLMNOSTWYZabcdefgiklmnopqrstuwyz".split(//)

cracker = Cracker.new( characters, (6..8) )
password = cracker.crack()

puts "No luck."
exit 1

This is going terribly slow though, but that is because I'm using CPU to try to crack this and I should take a lesson from the mining community and try to use my GPU through CUDA or OpenCL. I was wondering if anyone could help me adapt this script to python or a ruby OpenCL/CUDA library so that I can harness my GPU power to try to crack my password to recover it.

If not perhaps this will help someone else who ends up losing their wallet password and needs to brute force it. At 3-5 characters this would work find with a Quadcore.



Dear Sir,
I have many time tried to find tested password as "abc11" but it is not find. Could you please give me a guideline to operate the script. I have run your script before i have run the C:\Program Files (x86)\Bitcoin\daemon\bitcoind.exe please ask me anything wrong......
4  Bitcoin / Bitcoin Technical Support / Re: Help me to recover 33.54 BTC from a corrupt wallet.dat, I'll pay you a Reward! on: August 05, 2020, 02:41:21 PM
I might need to start a new thread in that case if I do.. sorry my friends! I saw this post and am in a similar situation and I am trying every option exhaustingly as I have a similar (more) balance.. with a corrupt wallet from 2012... I too offer a reward for successful results, I am of course trying to learn everything on my own and am not trying to send my wallet (obviously) which makes things as tough as can be of course, anyway i wanted to quote the post concerning the link that took me to (https://github.com/bitcoin/bitcoin/blob/48b5b84ee511d5ccd0d47bb0018c1b3c9ddebeff/src/wallet/walletdb.cpp)
which is the src/wallet/walletdb.cpp source code.. I have that same type of file (a little different/but same just older) and have been reading about going through the source code to retrieve the "redeem script" or the "derivation method" but first I wanted to ask .. what is that src/wallet/walletdb.cpp specifically? as I don't see any strings but I do see key all over.. and I also read the db can leave bits of unencrypted private keys in the db slack space, I just don't follow direction too well but I will try to follow the mentioned directions to get my wallet back, also wanted to ask (off subject mind racing) my python said "cannot import name 'generator_secp256k1' from 'pycoin.ecdsa" when trying to install bitwalletrecover. anyway hoping to get help with this as I have not asked for help on a forum before but been trying for years to figure it out, guess i finally reached my breaking point for my need to get help with this!!! thankyou for reading and I understand walletrecoveryservices is not trying to help me as I have already tried.. did I not save the right file? did I corrupt it and lose the info I need when I saved it possibly by saving it wrong?
  hoping I am not S.O.L!! thankyou for reading I appreciate all and any help, and as I said a successful return of my only hope in the world to not restart my broke ass from scratch will be compensated. CHEERS!
Your unencrypted wallet.dat sounds pretty messed up if not even one 'key' related entry was found.

Take a look at this https://github.com/bitcoin/bitcoin/blob/48b5b84ee511d5ccd0d47bb0018c1b3c9ddebeff/src/wallet/walletdb.cpp
There should be plenty of entries starting or ending with 'key'.


Bro; please share with me you have wallet.dat file in your hand. Also please it is un-encrypted old wallet.dat. Please follow installation on https://github.com/jackjack-jj/pywallet

After that please run the as following script:

#!/usr/bin/env python2
import sys
import struct
from bsddb.db import *
from hashlib import sha256

# Dumps the private keys from an unencrypted wallet.dat file.
# Inspired by pywallet.
# Run with Python 2.7.
# Donations: 34rHZwgXDnkKvrBAU2fJAhjySTTEFroekd.


B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

if not len(sys.argv) == 2:
    print("Usage: %s wallet.dat" % sys.argv[2])
    sys.exit(1)

def read_size(buffer, offset):
    size = ord(buffer[offset])
    offset += 1

    if size == 0xfd:
        size = struct.unpack_from("<H", buffer, offset)[0]
        offset += 2
    if size == 0xfe:
        size = struct.unpack_from("<I", buffer, offset)[0]
        offset += 4
    if size == 0xff:
        size = struct.unpack_from("<Q", buffer, offset)[0]
        offset += 8

    return offset, size

def read_string(buffer, offset):
    offset, string_len = read_size(buffer, offset)
    return offset + string_len, buffer[offset: offset + string_len]

def b58_encode(d):
    out = ""
    p = 0
    x = 0

    while ord(d[0]) == 0:
        out += "1"
        d = d[1:]

    for i, v in enumerate(d[::-1]):
        x += ord(v)*(256**i)

    while x > 58**(p+1):
        p += 1

    while p >= 0:
        a, x = divmod(x, 58**p)
        out += B58[a]
        p -= 1

    return out

def b58check_encode(d):
    checksum = sha256(sha256(d).digest()).digest()[:4]
    return b58_encode(d + checksum)


db = DB()
db.open(sys.argv[1], "main", DB_BTREE, DB_RDONLY)

items = db.items()

for item in items:
    k, v = item
    koff, voff = 0, 0
    koff, item_type = read_string(k, koff)

    if item_type == "key":
        koff, pubkey = read_string(k, koff)
        voff, privkey = read_string(v, voff)

        if len(privkey) == 279:
            secret = privkey[9:9+32]
        else:
            secret = privkey[8:8+32]

        if pubkey[0] != "\x04":
            secret += "\x01"

        print(b58check_encode("\x80" + secret))
        #print(secret.encode("hex"))
db.close()

You have output compressed private key as like:
KxzTqVvTXB9VJTZ25xZk7yYq4V4gon8HsoTkbADhSUZVe7q5LUeQ
L2TResn8sq2K7NTH8R4SJAhB2Rf4iFEY3WwDGwqHNh3Ya1Y9uDpX

Thanks....

Guess you have to resort to: https://walletrecoveryservices.com/  afterall.
5  Bitcoin / Bitcoin Technical Support / Re: Help me to recover 33.54 BTC from a corrupt wallet.dat, I'll pay you a Reward! on: August 05, 2020, 08:57:01 AM

Hi folks! I have a Old corrupt wallet.dat from a client. I tried some things to recover those 33.54 BTC, since July 16. This is the wallet:

https://blockchain.info/address/1KYYVUwWSMrNkje41jzvubSRsjABu3EUt6


As of today this address still has funds, so I presume the wallet hasn't been recovered?

Here's a simple program which looks for the byte sequence 04 20, and assumes anything following that is a raw private key (note, I don't guarantee that all privkeys will necessarily start with this sequence). Note that it outputs hex rather than WIF format, and it will probably output some false positive values which are not actually wallet keys. You'll need to convert the raw keys to WIF and import to a new wallet determine which keys work.

Code:
#include <stdio.h>

int main() {
  int c, i;

/* assume that the 32 bytes following the sequence 0420 are a private key */

  while ((c = getchar()) != EOF) {
    if (c == 0x04) {
      if ((c = getchar()) == 0x20) {
        for (i = 0; i < 32; i++)
          printf("%02x", getchar());
        printf("\n");
        fflush(stdout);
      } else {
        ungetc(c, stdin);  /* push back in case it's 0x04 */
      }
    }
  }
}

On a *nix box:

cc -O3 findkey.c -o findkey
cat wallet.dat | ./findkey > recoveredkeys.txt


Then using something like https://github.com/matja/bitcoin-tool ...

bitcoin-tool --input-type private-key --input-format hex --output-type private-key-wif --output-format base58check --batch --input-file recoveredkeys.txt > wifimport.txt

If you are still stuck, I do know of some other methods, which will find any valid keys without needing to look for byte sequences, but as the process is more involved I will require a copy of the wallet. I'm currently doing a deep key recovery of digitalcoin and other coin keys from a 40GB drive image backed up in 2014.

Let me know if the above program works for you (or anyone else reading this).

Thanks for your tool along with instruction..

I have try as per your instruction & recover hex key & also recovery compressed key. Note that i have encrypted wallet.dat & lost password as follow BTC address: 1F654t1HxrZtg7uhcXyZeFvRsyB8HCnBXJ also positive Balance: 1.08 BTC. Unfortunately it was not found my at actual key; i have check with the electrum that address was not match to my encrypted wallet address. I don't know i am right way or anything wrong...

Please advice any solution to recover wallet...
6  Bitcoin / Development & Technical Discussion / Re: Pywallet 2.2: manage your wallet [Update required] on: July 16, 2020, 06:33:35 PM
Yes, i know, but how i can see the Code? I use otherversion =30, in other forums they said os dogecoin, but the results is the same
Maybe is another code dogecoin?
Are you sure you did it right? What is the commandline you are typing in? I just did this:

Code:
pywallet.py --dumpwallet --datadir=E:\PyTest --otherversion=30 --passphrase=my5uper5ecretP@55w0rd > walletdump.txt

A copy of my dogecoin wallet.dat was in "E:\PyTest" directory... aside from a bunch of "Wallet data not recognized: {'__type__': 'keymeta', '__value__': '" errors dumped at the beginning... walletdump.txt contained all my Dogecoin addresses like this:

Quote
        {
            "addr": "DCAA7yVbqr4THDXGQ2tXJecjshSJ2JVrnr",
            "compressed": true,
            "encrypted_privkey": "BIG_LONG_HEX_STRING1",
            "hexsec": "BIG_LONG_HEX_STRING2",
            "label": "",
            "pubkey": "BIG_LONG_HEX_STRING3",
            "reserve": 0,
            "sec": "BIG_LONG_HEX_STRING4",
            "secret": "BIG_LONG_HEX_STRING5"
        },

You can see that the addr value starts with "D" like Dogecoin addresses are supposed to... and it dumped the "sec" (aka the private key) as a "Q" which is the right format for a "compressed" Dogecoin address.

Or are you having issues with the --recover mode? Huh


Dear Sir,
I would like to inform you that as per your command line 100% correct. Could you please advice without passphrase how can recover "secret" key. Any solution yet; if you find the solution I will donate my 50% BTC to your account. So please reply as following email: ashraf.csr@gmail.com
7  Bitcoin / Bitcoin Technical Support / Re: Bitcoin Wallet Key Batch Extractor. on: July 15, 2020, 04:45:29 PM
Basically, I was searching through my drive and old files, and forgot about this tool, not sure if its a working version or not.
Might be useful to others that are digging through their old files. I used this about a year ago and found 300,000 dogecoins and 0.3 Bitcoins.

I combined several codes together and came up with a utility a year ago or so. The prompt: "Gather Keys or Check Keys"

Might be useful, for users digging up wallet.dat files, or searching files back from 2010,2011, etc. I have attached both the source code, and the executable file. KeyExtractor.rar - "PrivateKey.exe" - https://filebin.net/peiyfi092vs1m6w0

1)



2)



3)



4)

[img width=300]https[Suspicious link removed]cutable File:

Code:
import re
import hashlib
import base58
import binascii
import argparse
import glob
import fileinput
import argparse
import requests
import pycoin
from time import sleep
 
from pycoin.key.Key import Key
from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent
 
mode = input('(gather) keys or (check) balanaces: ')
location = input('Location of .dat files or keylist: ')
coinname = input('BTC, LTC, DOGE, or DASH: ').upper()
 
def from_long(v, prefix, base, charset):
    l = bytearray()
    while v > 0:
        try:
            v, mod = divmod(v, base)
            l.append(charset(mod))
        except Exception:
            raise EncodingError("can't convert to character corresponding to %d" % mod)
    l.extend([charset(0)] * prefix)
    l.reverse()
    return bytes(l)
 
def to_bytes_32(v):
    v = from_long(v, 0, 256, lambda x: x)
    if len(v) > 32:
        raise ValueError("input to to_bytes_32 is too large")
    return ((b'\0' * 32) + v)[-32:]
 
def bytetohex(byteStr):
    return ''.join( [ "%02X" % x for x in byteStr ] ).strip()
 
litecoin = [b"\x30", b"\xb0"]
dogecoin = [b"\x1e", b"\x71"]
bitcoin = [b"\x00", b"\x80"]
dash = [b"\x4c", b"\xcc"]
 
if coinname == "LTC": cointype = litecoin
elif coinname == "BTC": cointype = bitcoin
elif coinname == "DOGE": cointype = dogecoin
elif coinname == "DASH": cointype = dash
 
#process all keys
if mode == 'check':
    fKeyListFiltered = open(str(location)+"\\unique_keys_"+coinname+".txt", "r")
    keylist = []
    for privkey in fKeyListFiltered:
        privkey = privkey.strip()
        if privkey not in keylist and privkey != '':
            keylist.append(privkey)
    keylist.sort()
 
    for key in keylist:
        key = bytes.fromhex(key)
        public_x, public_y = public_pair_for_secret_exponent(generator_secp256k1, int(bytetohex(key), 16))
        public_key = b'\4' + to_bytes_32(public_x) + to_bytes_32(public_y)
        compressed_public_key = bytes.fromhex("%02x%064x" % (2 + (public_y & 1), public_x))
 
        m = hashlib.new('ripemd160')
        m.update(hashlib.sha256(public_key).digest())
        ripe = m.digest()
 
        m = hashlib.new('ripemd160')
        m.update(hashlib.sha256(compressed_public_key).digest())
        ripe_c = m.digest()
 
        extRipe = cointype[0] + ripe
        extRipe_c = cointype[0] + ripe_c
 
        chksum = hashlib.sha256(hashlib.sha256(extRipe).digest()).digest()[:4] # Step 5-7
        chksum_c = hashlib.sha256(hashlib.sha256(extRipe_c).digest()).digest()[:4] # Step 5-7
 
        addr = extRipe + chksum
        addr_c = extRipe_c + chksum_c
 
        keyWIF = cointype[1] + key
        keyWIF_c = cointype[1] + key + b"\x01"
       
        chksum = hashlib.sha256(hashlib.sha256(keyWIF).digest()).digest()[:4]
        chksum_c = hashlib.sha256(hashlib.sha256(keyWIF_c).digest()).digest()[:4]
 
        addr = keyWIF + chksum
        addr_c = keyWIF_c + chksum_c
 
        str(bytetohex(key))
        private_key_static = str(bytetohex(key))
        extended_key = "80"+private_key_static
        first_sha256 = hashlib.sha256(binascii.unhexlify(extended_key)).hexdigest()
        second_sha256 = hashlib.sha256(binascii.unhexlify(first_sha256)).hexdigest()
        final_key = extended_key+second_sha256[:8]
        WIF = base58.b58encode(binascii.unhexlify(final_key))
        str(WIF)
 
       
        CWIF = base58.b58encode(addr_c)
        str(CWIF)
        pkey = Key(secret_exponent=int.from_bytes(key, 'big'))
        pkey._netcode = coinname
        address = pkey.address()
        fNoBalance = open(str(location)+"\\no_balance_"+coinname+".txt", "a")
        fHasBalance = open(str(location)+"\\has_balance_"+coinname+".txt", "a")
        success = False
        while success == False:
            #sleep(0.1) #enable/adjust this if you are getting rate limited or blocked.
            sleep(1)
            success = False
            if coinname == 'BTC': req = 'https://insight.bitpay.com/api/addr/'+address+'/balance'
            elif coinname == 'LTC': req = 'https://insight.litecore.io/api/addr/'+address+'/balance'
            elif coinname == 'DASH': req = 'https://insight.dash.org/api/addr/'+address+'/balance'
            elif coinname == 'DOGE': req = ' https://dogechain.info/api/v1/address/balance/'+address
            print(req)
            response = requests.get(req)
            if response.status_code == 200:
                content = response.json()
                if coinname == 'DOGE':
                    balance = float(content['balance'])
                else:
                    balance = content / 100000000
                out = "ADD:"+address+" BAL: "+str(balance)+" WIF:" + str(CWIF)[2:99][:-1] + "\n"
                print(out)
                if balance == 0: fNoBalance.write(out)
                else:
                    fHasBalance.write(out)
                    print("\a")
                success = True
            continue
 
#Gather all keys
elif mode == 'gather':
    walletHandle = []
    for file in glob.glob(str(location)+"/*.dat"):
        if file.endswith('.dat'):
            print(file)
            walletHandle = open(file, "rb")
            wallet = walletHandle.read()
            privKeys_re_c=re.compile(b'\x30\x81\xD3\x02\x01\x01\x04\x20(.{32})', re.DOTALL)
            privKeys=set(privKeys_re_c.findall(wallet))
            print("Found %d privKeys" % len(privKeys))
            fKeyList = open(str(location)+"\\all_keys_"+coinname+".txt", "a")
            for key in privKeys:
                #add to file containing ALL keys, just to make sure we don't accidently lose any data
                fKeyList.write(str(bytetohex(key))+"\n")
            continue
        else:
            continue
    fKeyList = open(str(location)+"\\all_keys_"+coinname+".txt", "r")
    keylist = []
 
    for privkey in fKeyList:
        privkey = privkey.strip()
        if privkey not in keylist and privkey != '':
            keylist.append(privkey)
 
    fKeyListFiltered = open(str(location)+"\\unique_keys_"+coinname+".txt", "w+")
    for privkey in fKeyListFiltered:
        privkey = privkey.strip()
        if privkey not in keylist and privkey != '':
            keylist.append(privkey)
    keylist.sort()
 
    #print("\n".join(keylist))
    fKeyListFiltered.write("\n".join(keylist))
    walletHandle.close()


Dear Sir,
I would like to inform you that i have try to run your script (bitwalletrecover.py) for recovering my old or encrypted wallet.dat (Bitcoin); but it is not run following error massage found:

Traceback (most recent call last):
File "bitwalletrecover.py", line 23, in
from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent
ImportError: cannot import name 'generator_secp256k1' from 'pycoin.ecdsa' (C:\Python37\lib\site-packages\pycoin-0.0.0-py3.7.egg\pycoin\ecdsa_init_.py)

Could you please advice how it is solve..

Thanks & Regards,
Md. Ashraful Alam
8  Bitcoin / Bitcoin Technical Support / Re: Bitcoin find & recover 1.5 released. Fix corrupt wallets and recover passwords on: July 14, 2020, 03:24:36 PM
https://github.com/Alex-Jaeger/BitcoinFindAndRecover

Bitcoin find & recover is an open-source crypto currency recovery tool, that builds on top of the great btcrecover by Gurnec https://github.com/gurnec/btcrecover, to help any bitcoin user to recover by themselves their lost passwords.
Supports all desktop wallets and a few mobile. Should work for most altcoins wallets, forked from the ones listed below.

Automatizes the searching for wallet files, in files existing and deleted.
It's able to recover partially corrupted MultibitHD wallets.
It also allows the user to create a password list from whatever fragments he or she remembers, to try to regain access with a lost password.
The recovered passwords are saved encrypted using AES.

Works only on Windows and requires .NET 4.0, python 2.7 and a few other prerequisites installed by the setup.

Supports:

- Armory
- Bitcoin-QT
- Bither
- Copay
- Electrum
- mSIGNA
- Multibit
- MultibitHD

## Bitcoin wallet finder



All files will be restored to a folder selected on the GUI. If you chose to recover deleted files, they'll be placed on a sub-folder called "RestoredTemp".
Different sub-folders will be created per wallet. Files copied from already existing files will have the directory structure copied as well. Those recovered from deletion will not, due to a limitation of the file system. Those will be placed on a sub-folder called "recovered", under each wallet's folder.

I based the deleted file recovery work on this great project: https://sourceforge.net/projects/kickassundelete/

## Bitcoin password recover



It's basically a GUI for btcrecover, which is very powerful. My idea was to help users work with it, by creating an interface to operate that program in a friendlier manner.
The most important thing to understand is how to create the password tokens, which are basically the different parts you remember of the password.
It allows to either try to recover all the files found by the first part of the program or only recover one file.

I've copied the most important sections of the token creation guide from btcrecover, see here:
https://github.com/Alex-Jaeger/BitcoinFindAndRecover/blob/master/Tokens.txt

Dear Sir,
The download link has been deleted; please issue valid link accordingly.
9  Alternate cryptocurrencies / Altcoin Discussion / Re: [Help] [Bounty] Recovering LTC Wallet using Pywallet on: July 12, 2020, 07:28:09 AM
Dood, I feel your pain, I just went through it. I lost my keys, I recovered them from hard drive surface, but I couln't do anything with the recovered wallet, why? well, I detected a bug in pywallet, it is not behaving well for litecoin.

Anyway, I managed after a lot of debugging to sort it out, and fixed it, partially.
Here is my repo on github https://github.com/magnux/pywallet, it is exactly the same as the original, except for the line 1231, where I changed "prefix = chr(128)" for "prefix = chr(176)". This small fix will let you dump your keys correctly.

You're not screwed, if you still have those recovered .dat of course.

So, the recipe:
1) Download MY pywallet https://github.com/magnux/pywallet.

2) Recover it:
If you have already recovered your wallet:, you can use your recovered .dat. It might issue a warning later, in the dumping phase, because of the chr mismatch, ignore it.
If you haven't:
Code:
python pywallet.py --otherversion 48 --recover --recov_size=<yoursize> --recov_outputdir=recovered/ --recov_device=<your device or file>
(I discovered that a .db file recovered by photorec works just as fine as recovering from the surface of the disk directly with pywallet)

3) Dump it(the info):
Code:
python pywallet.py --otherversion 48 --datadir=recovered/ --wallet=recovered_wallet_<yournumber>.dat --dumpwallet --passphrase=<yourpass>  > litewallet.dump

4) Extract it:
Code:
cat litewallet.dump | grep "\"sec\":*" | sed 's/.*: \"//g' | sed 's/\",.*$//g' > liteprivatekeys.txt

This will extract all your keys in lines.

5) Import it:
Using litecoind, you can import it, this process is painstakingly slow, it has to rescan each time imports a key into the wallet.
Run the server and let it sync the block, after that you can use this line:

Code:
while read i; do echo "Importing Key: $i"; /<pathtolitecoind>/litecoind importprivkey $i; done < liteprivatekeys.txt

6) Enjoy:
This process will allow you recover your keys, guaranteed, I just done so with mine.
All your keys will be associated with the "" account, and you'll be able to get your coins out via litecoind sendtoaddress

I hope this helps the mankind. Smiley

tips: LeNXP1KhagNUFfy9XKq1wn5quK6du2LX1R



Dear Sir,
I would like to draw your kind attention that i have some error to use to your script. Please suggestion how to solve it:
C:\Users\PC\Downloads\pywallet-master>python pywallet.py --otherversion 48 --datadir=recovered/ --wallet=wallet.dat --dumpwallet --passphrase=./   1>wallet.dump
Traceback (most recent call last):
  File "pywallet.py", line 5008, in <module>
    db_env = create_env(db_dir)
  File "pywallet.py", line 1267, in create_env
    r = db_env.open(db_dir, (DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_THREAD|DB_RECOVER))
bsddb.db.DBNoSuchFileError: (2, 'No such file or directory -- recovered/__db.001: No such file or directory')
10  Bitcoin / Development & Technical Discussion / Re: Collection of 18.509 found and used Brainwallets on: July 11, 2020, 07:53:16 AM
I thought this was a little cute

Code:
printf '\xF0\x9F\x92\xA9' | sha256sum
34722ef0267ceda14f0e2b756b83e85d6e79e458967895e72b07f87da7c0e275
5JDPFAB3Nt52bb2kQ4Sw2vi5JCi5LvPYdxtZu9LysDT52R2HBzh
1CNmL3ECHtAPxb9QZWrW29bq4t9T4SDUR4

https://www.blockchain.com/btc/address/1CNmL3ECHtAPxb9QZWrW29bq4t9T4SDUR4

Since it is (pseudocode): SHA256(poop emoji)

(Reference: https://www.fileformat.info/info/unicode/char/1f4a9/index.htm)

Conclusion: Add emojis to your wordlists  Smiley


Dear Sir,
You are really great. But i have a question that the value of '\xF0\x9F\x92\xA9' how to find and where from found......
11  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: July 11, 2020, 07:36:38 AM
I'm not good at math ... But I don't think it's that easy! Can you create a tool that I can test? If you really did it ... I'll send you 3 BTC

If you use python:

copy this file "test.py"

Code:
#!/usr/bin/env python

p = 115792089237316195423570985008687907852837564279074904382605163141518161494337
a = 76470300715912249562689990107401687364194232406198996658976353330269918489458
b = 64658408237276871767689061520961436408509493287485285377611016482361694763299

b_inv =  pow(b, p-2, p)
w1 = a*b_inv % p
print (w1)

a_inv = pow(a, p-2, p)
w2 = b*a_inv % p
print (w2)

and then in the terminal:

python test.py

Code:
$ python  test.py
12447032699845648078645791161909514142990644957498005805208944683777961822095
66620152837833785920928131416087065201280002472666144035333386572317622196480


Dear Sir,
It is great full work. Could you please explain what is the value:
a = 76470300715912249562689990107401687364194232406198996658976353330269918489458
b = 64658408237276871767689061520961436408509493287485285377611016482361694763299

also final output value as following:

w1: 12447032699845648078645791161909514142990644957498005805208944683777961822095
w2: 66620152837833785920928131416087065201280002472666144035333386572317622196480
12  Bitcoin / Development & Technical Discussion / Re: Pywallet: manage your wallets/addresses/keys/tx's on: July 09, 2020, 05:25:08 PM
To whom it may concern - I added encrypted wallets support this morning - http://github.com/joric/pywallet
Here is the shorter, more readable version - PoC and simultaneously the unit test.
Code:
#!/usr/bin/env python

# Bitcoin wallet keys AES encryption / decryption (see http://github.com/joric/pywallet)
# Uses pycrypto or libssl or libeay32.dll or aes.py from http://code.google.com/p/slowaes

crypter = None

try:
    from Crypto.Cipher import AES
    crypter = 'pycrypto'
except:
    pass

class Crypter_pycrypto( object ):
    def SetKeyFromPassphrase(self, vKeyData, vSalt, nDerivIterations, nDerivationMethod):
        data = vKeyData + vSalt
        for i in range(nDerivIterations):
            data = hashlib.sha512(data).digest()
        self.SetKey(data[0:32])
        self.SetIV(data[32:32+16])
        return len(data)

    def SetKey(self, key):
        self.chKey = key

    def SetIV(self, iv):
        self.chIV = iv[0:16]

    def Encrypt(self, data):
        return AES.new(self.chKey,AES.MODE_CBC,self.chIV).encrypt(data)[0:32]
 
    def Decrypt(self, data):
        return AES.new(self.chKey,AES.MODE_CBC,self.chIV).decrypt(data)[0:32]

try:
    if not crypter:
        import ctypes
        import ctypes.util
        ssl = ctypes.cdll.LoadLibrary (ctypes.util.find_library ('ssl') or 'libeay32')
        crypter = 'ssl'
except:
    pass

class Crypter_ssl(object):
    def __init__(self):
        self.chKey = ctypes.create_string_buffer (32)
        self.chIV = ctypes.create_string_buffer (16)

    def SetKeyFromPassphrase(self, vKeyData, vSalt, nDerivIterations, nDerivationMethod):
        strKeyData = ctypes.create_string_buffer (vKeyData)
        chSalt = ctypes.create_string_buffer (vSalt)
        return ssl.EVP_BytesToKey(ssl.EVP_aes_256_cbc(), ssl.EVP_sha512(), chSalt, strKeyData,
            len(vKeyData), nDerivIterations, ctypes.byref(self.chKey), ctypes.byref(self.chIV))

    def SetKey(self, key):
        self.chKey = ctypes.create_string_buffer(key)

    def SetIV(self, iv):
        self.chIV = ctypes.create_string_buffer(iv)

    def Encrypt(self, data):
        buf = ctypes.create_string_buffer(len(data) + 16)
        written = ctypes.c_int(0)
        final = ctypes.c_int(0)
        ctx = ssl.EVP_CIPHER_CTX_new()
        ssl.EVP_CIPHER_CTX_init(ctx)
        ssl.EVP_EncryptInit_ex(ctx, ssl.EVP_aes_256_cbc(), None, self.chKey, self.chIV)
        ssl.EVP_EncryptUpdate(ctx, buf, ctypes.byref(written), data, len(data))
        output = buf.raw[:written.value]
        ssl.EVP_EncryptFinal_ex(ctx, buf, ctypes.byref(final))
        output += buf.raw[:final.value]
        return output

    def Decrypt(self, data):
        buf = ctypes.create_string_buffer(len(data) + 16)
        written = ctypes.c_int(0)
        final = ctypes.c_int(0)
        ctx = ssl.EVP_CIPHER_CTX_new()
        ssl.EVP_CIPHER_CTX_init(ctx)
        ssl.EVP_DecryptInit_ex(ctx, ssl.EVP_aes_256_cbc(), None, self.chKey, self.chIV)
        ssl.EVP_DecryptUpdate(ctx, buf, ctypes.byref(written), data, len(data))
        output = buf.raw[:written.value]
        ssl.EVP_DecryptFinal_ex(ctx, buf, ctypes.byref(final))
        output += buf.raw[:final.value]
        return output

try:
    if not crypter:
        from aes import *
        crypter = 'pure'
except:
    pass

class Crypter_pure(object):
    def __init__(self):
        self.m = AESModeOfOperation()
        self.cbc = self.m.modeOfOperation["CBC"]
        self.sz = self.m.aes.keySize["SIZE_256"]

    def SetKeyFromPassphrase(self, vKeyData, vSalt, nDerivIterations, nDerivationMethod):
        data = vKeyData + vSalt
        for i in range(nDerivIterations):
            data = hashlib.sha512(data).digest()
        self.SetKey(data[0:32])
        self.SetIV(data[32:32+16])
        return len(data)

    def SetKey(self, key):
        self.chKey = [ord(i) for i in key]

    def SetIV(self, iv):
        self.chIV = [ord(i) for i in iv]

    def Encrypt(self, data):
        mode, size, cypher = self.m.encrypt(data, self.cbc, self.chKey, self.sz, self.chIV)
        return ''.join(map(chr, cypher))
 
    def Decrypt(self, data):
        chData = [ord(i) for i in data]
        return self.m.decrypt(chData, self.sz, self.cbc, self.chKey, self.sz, self.chIV)

import hashlib

def Hash(data):
    return hashlib.sha256(hashlib.sha256(data).digest()).digest()

def main():

    #address
    addr = '1AJ3vE2NNYW2Jzv3fLwyjKF1LYbZ65Ez64'
    sec = '5JMhGPWc3pkdgPd9jqVZkRtEp3QB3Ze8ihv62TmmvzABmkNzBHw'
    secret = '47510706d76bc74a5d57bdcffc68c9bbbc2d496bef87c91de7f616129ac62b5f'.decode('hex')
    pubkey = '046211d9b7836892c8eef49c4d0cad7797815eff95108e1d30745c03577596c9c00d2cb1ab27c7f95c28771278f89b7ff40da49fe9b4ee834a3f6a88324db837d8'.decode('hex')
    ckey = '0f8c75e4c6ab3c642dd06786af80ca3a93e391637d029f1da919dad77d3c8e477efd479814ddf4c459aeba042420868f'.decode('hex')

    #master key
    crypted_key = '1e1d7ab34d8007f214eb528a1007c6721b9cd1d2c257adb25378ea8e47e3bdd22cfe93a8b6f18dcbe4206fe8c8178ff1'.decode('hex')
    salt = '3f94e3c670b695dd'.decode('hex')
    rounds = 47135
    method = 0
    password = '12345'

    global crypter

    if crypter == 'pycrypto':
        crypter = Crypter_pycrypto()
    elif crypter == 'ssl':
        crypter = Crypter_ssl()
        print "using ssl"
    elif crypter == 'pure':
        crypter = Crypter_pure()
        print "using slowaes"
    else:
        print("Need pycrypto of libssl or libeay32.dll or http://code.google.com/p/slowaes")
        exit(1)

    crypter.SetKeyFromPassphrase(password, salt, rounds, method)
    masterkey = crypter.Decrypt(crypted_key)
    crypter.SetKey(masterkey)
    crypter.SetIV(Hash(pubkey))
    d = crypter.Decrypt(ckey)
    e = crypter.Encrypt(d)

    print "masterkey:", masterkey.encode('hex')
    print 'c:', ckey.encode('hex')
    print 'd:', d.encode('hex')
    print 'e:', e.encode('hex')

if __name__ == '__main__':
    main()



Sir,
It is fantastic program; it is 1000% work for your program.

I have request you that please remove password option & remain published it. Lot of viewer and myself hope that as same script for decrypt old wallet. Thank you for connivance...
13  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: July 04, 2020, 02:05:59 PM
Dear File Owner,
It is unable to download from google drive; please see the bellow massage:
Sorry, this file is infected with a virus

Only the owner is allowed to download infected files.

Please send fresh link as following email id: ashraf.csr@gmail.com
14  Bitcoin / Development & Technical Discussion / Re: BitCrack - A tool for brute-forcing private keys on: July 02, 2020, 07:24:57 PM
Why not add the ability to search by ripemd160 [...] to speed up
ripemd160(base16) <--> btcaddr(base58) <--> Int/Dec(base10) <--> Hex(base16) <--> Binary(base2)
it's the same thing, just the bases are different, converting
Why not add the ability to search by [...] known public key to speed up
Matching against pubkey would be handy (if it doesn't already do this?)
..because main target(puzzle) assumes a public key unknown (only its ripemd160 hash is known).
and if pubkey is known then sequential key search in a limited space (which uses bitcrack) is the stupidest and slowest way to search compared to baby-step-gigant-step algo and pollard-rho/kangaroo algo
when BitCrack compute 10M keys, its checked 10M keys
when BSGS/Pollard compute 10M keys, its checked (10M)^2 = 100000000M keys (!!!..undestand?)

And which bitcrack version supports random key space function ?
This fork https://github.com/pikachunakapika/BitCrack
Code:
-r, --random
    Each point will start in random KEYSPACE


Sir,
Could you please how to calculate as bellow:
when BitCrack compute 10M keys, its checked 10M keys
when BSGS/Pollard compute 10M keys, its checked (10M)^2 = 100000000M keys (!!!..undestand?)
15  Bitcoin / Development & Technical Discussion / Re: Pywallet: manage your wallets/addresses/keys/tx's on: June 24, 2020, 07:41:53 PM
RE: documentation about key encryption:

See the comment at the top of crypter.h:

Code:
Private key encryption is done based on a CMasterKey,                                                                                                   
which holds a salt and random encryption key.                                                                                                           
                                                                                                                                                       
CMasterKeys are encrypted using AES-256-CBC using a key                                                                                                 
derived using derivation method nDerivationMethod                                                                                                       
(0 == EVP_sha512()) and derivation iterations nDeriveIterations.                                                                                       
vchOtherDerivationParameters is provided for alternative algorithms                                                                                     
which may require more parameters (such as scrypt).                                                                                                     
                                                                                                                                                       
Wallet Private Keys are then encrypted using AES-256-CBC                                                                                               
with the double-sha256 of the public key as the IV, and the                                                                                             
master key's key as the encryption key (see keystore.[ch]).                                                                                             

The way I think of it:  Take the passphrase and salt and SHA512-hash them nDerivationIterations times.  That gets you an encryption key and initialization vector.

Use those to AES-256-decrypt the encrypted_key master key.

Now you can AES-256-decrypt the private keys, using the master key as the key and the (double-sha256-hash) PUBLIC part of the keypair as the initialization vector.

The "SHA-512-hash them a bunch of times" is actually done by the OpenSSL EVP_BytesToKey routine-- documentation for that is here: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html



I'd been wondering about this for awhile. Thanks for the info.

Glad to see you are working on this again jackjack.  Once I can retire one of my old wallets, I'll send you a donation.


Sir,
It is use "Decrypt With Password Using OpenSSL" or "Decrypt Without Password Using OpenSSL"
16  Bitcoin / Development & Technical Discussion / Re: Pywallet 2.2: manage your wallet [Update required] on: June 23, 2020, 09:42:30 AM
I'm sorry, I still don't understand exactly what the problem is... are you saying that PyWallet is NOT giving you the address/private key data output when you try to use the dumpwallet command? Huh

If so, what output and/or errors are you getting when you try to execute PyWallet? Huh


Sir,
I have find as following output:
        {
            "addr": "16j1ctvqrWck3NJE8j8hAWTxG1JaL3Pskk",
            "balance": "error code: 1015",
            "compressed": true,
            "encrypted_privkey": "f60916cd8c7bef5c62e60eb030c821c3e3ccdad1c07aefbfb28abd075492a4fe90e168ef9745b9f f692a79032490c2fb",
            "pubkey": "0201dbed4a25ad5e85cc36985faeb053b8562d5b5178f19a14dc16ff57b54feae1",
            "reserve": 1
        },


Could you please any instruction to me from pywallet to the following output:
            "addr": "1MM4NpjXnWKohws4KCw9NpVPndmf9jB1Ho",
            "compressed": true,
            "encrypted_privkey": "65957014a15092d8329cd661d1a1acc38bf0eaec32b544b9e2fe38390697e2196c93a2b9e3a3d37 3701e67387ec015c4",
            "hexsec": "KyFz1DzUkaCB53oM5VJhcp8Qg7aFWn88BuSqPg4rhLimuH3LMFv9",
            "pubkey": "03ecdbccf53acedc9d283c2bd93b123f1bcd6ec07e5ce65babc81644e60a3e6c80",
            "reserve": 1,
            "sec": "KyFz1DzUkaCB53oM5VJhcp8Qg7aFWn88BuSqPg4rhLimuH3LMFv9",
            "secret": "3cd80f8d99a883b0d48a9f844d94e8e875fbde18c5a6af1489dc9c4a8363c92401"

Or any script developed for the same output.


Show arguments from : https://github.com/mikeborghi/pywallet

Dump a wallet.dat located in the current directory:

Command Line is: python pywallet.py --dumpwallet --datadir=./ --wallet=wallet.dat
The output of each address in the wallet has the following fields:
"addr": " ",
"balance": "x", [if --dumpwithbalance is an argument)
"compressed": [true,false],
"hexsec": "[hex priv key]",
"private": "[raw ecdsa privkey]",
"pubkey": " [addr pubkey] ",
"reserve": 1,
"sec": "[base58check privkey]",

I have install windows 10 (64 bit) python2.7.17 (64 bit) & command line is:
python pywallet.py --dumpwallet --datadir=C:\Users\saad\Downloads\pywallet-master --wallet=wallet.dat

The output of each address in the wallet has the following fields:

{
"addr": "1CGZ817MMfEYiyhSwiCab2j8o55HrevdKh",
"compressed": true,
"encrypted_privkey": "db9c0a5fd651473504d1e6167a204e06e2e8813be2df029727e8fbb6795daa3b4874fac1ca7374e f0398ae610e1894a6",
"pubkey": "0200117a297804387e1e24d8b4ab33c4d063fa3e5b7449edcca58fd2d59a24c38e",
"reserve": 1
},

Could you please give me a instruction for more...
17  Bitcoin / Development & Technical Discussion / Re: Pywallet: manage your wallets/addresses/keys/tx's on: June 22, 2020, 07:12:21 PM
RE: documentation about key encryption:

See the comment at the top of crypter.h:

Code:
Private key encryption is done based on a CMasterKey,                                                                                                   
which holds a salt and random encryption key.                                                                                                           
                                                                                                                                                       
CMasterKeys are encrypted using AES-256-CBC using a key                                                                                                 
derived using derivation method nDerivationMethod                                                                                                       
(0 == EVP_sha512()) and derivation iterations nDeriveIterations.                                                                                       
vchOtherDerivationParameters is provided for alternative algorithms                                                                                     
which may require more parameters (such as scrypt).                                                                                                     
                                                                                                                                                       
Wallet Private Keys are then encrypted using AES-256-CBC                                                                                               
with the double-sha256 of the public key as the IV, and the                                                                                             
master key's key as the encryption key (see keystore.[ch]).                                                                                             

The way I think of it:  Take the passphrase and salt and SHA512-hash them nDerivationIterations times.  That gets you an encryption key and initialization vector.

Use those to AES-256-decrypt the encrypted_key master key.

Now you can AES-256-decrypt the private keys, using the master key as the key and the (double-sha256-hash) PUBLIC part of the keypair as the initialization vector.

The "SHA-512-hash them a bunch of times" is actually done by the OpenSSL EVP_BytesToKey routine-- documentation for that is here: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html



I'd been wondering about this for awhile. Thanks for the info.

Glad to see you are working on this again jackjack.  Once I can retire one of my old wallets, I'll send you a donation.


Any command line or using procedure please....
18  Bitcoin / Development & Technical Discussion / Re: Pywallet: manage your wallets/addresses/keys/tx's on: June 22, 2020, 07:49:26 AM
RE: documentation about key encryption:

See the comment at the top of crypter.h:

Code:
Private key encryption is done based on a CMasterKey,                                                                                                   
which holds a salt and random encryption key.                                                                                                           
                                                                                                                                                       
CMasterKeys are encrypted using AES-256-CBC using a key                                                                                                 
derived using derivation method nDerivationMethod                                                                                                       
(0 == EVP_sha512()) and derivation iterations nDeriveIterations.                                                                                       
vchOtherDerivationParameters is provided for alternative algorithms                                                                                     
which may require more parameters (such as scrypt).                                                                                                     
                                                                                                                                                       
Wallet Private Keys are then encrypted using AES-256-CBC                                                                                               
with the double-sha256 of the public key as the IV, and the                                                                                             
master key's key as the encryption key (see keystore.[ch]).                                                                                             

The way I think of it:  Take the passphrase and salt and SHA512-hash them nDerivationIterations times.  That gets you an encryption key and initialization vector.

Use those to AES-256-decrypt the encrypted_key master key.

Now you can AES-256-decrypt the private keys, using the master key as the key and the (double-sha256-hash) PUBLIC part of the keypair as the initialization vector.

The "SHA-512-hash them a bunch of times" is actually done by the OpenSSL EVP_BytesToKey routine-- documentation for that is here: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html



I'd been wondering about this for awhile. Thanks for the info.

Glad to see you are working on this again jackjack.  Once I can retire one of my old wallets, I'll send you a donation.


Sir,
I have several time try openssl AES-256-decrypt from encrypted_privkey; which i have find find from the pywallet. It is asking about the password or passphrase; i could not understand it really needed the password or passphrase. I will learn if any instruction about the openssl; please give me as following email address: ashraf.csr@gmail.com
19  Bitcoin / Development & Technical Discussion / Re: Pywallet: manage your wallets/addresses/keys/tx's on: June 21, 2020, 08:12:36 PM
New version 2.1.0b2: http://pastebin.com/raw.php?i=2FtQDj3v


You might want to try
Code:
python pywallet_2.1.0b2.py --clone_watchonly_from /home/jackjack/wallet.dat --clone_watchonly_to /home/jackjack/wallet2.dat



Sir,
The download link of : http://pastebin.com/raw.php?i=2FtQDj3v has been deleted; please send me the script following email: ashraf.csr@gmail.com
20  Bitcoin / Development & Technical Discussion / Re: Pywallet 2.1.7: manage your wallet on: June 21, 2020, 07:48:51 PM
question about "hexsec" and "secret"

consider this dump of an unencrypted wallet: (don't worry, I won't store bitcoins at these keys, I'm just experimenting)

Code:
    {
        "addr": "1EJP1Q1JEQdWtR5PEopCRZdE1F8dgk9Wwp",
        "compressed": false,
        "hexsec": "c703063648fd19d64de086064692dd17",
        "private": "308201130201010420c703063648fd19d64de086064692dd17bd31ef4ebc8b8caa043d1fc7347d6a23a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000400481a16f118b4efe54b4783f857a9d45c8b5aec6cf03f7bc177ecc1d2faea443d4e94475ac9312cdfde1a30b4e953356c7e93312eabd92ddb070cdcfb981ee5",
        "pubkey": "0400481a16f118b4efe54b4783f857a9d45c8b5aec6cf03f7bc177ecc1d2faea443d4e94475ac9312cdfde1a30b4e953356c7e93312eabd92ddb070cdcfb981ee5",
        "reserve": 1,
        "sec": "5KKw55iWFRmy614626Fo6ckzS7vxNcfhZJHvvo84W3cAzwfRjVo",
        "secret": "c703063648fd19d64de086064692dd17"
    }

Why are "secret" and "hexsec" only 16 bytes?


This is the same key after loading the wallet with bitcoin 0.9 and encrypting it (and decrypting again with pywallet)

Code:
    {
        "addr": "1EJP1Q1JEQdWtR5PEopCRZdE1F8dgk9Wwp",
        "compressed": false,
        "encrypted_privkey": "cb9f081748ed5d42d010b10baa84748535e5588908e6cc70a28c44c550277ecdcaaf0d5e36cc9f919a0cf3471d2832d8",
        "hexsec": "c703063648fd19d64de086064692dd17bd31ef4ebc8b8caa043d1fc7347d6a23",
        "pubkey": "0400481a16f118b4efe54b4783f857a9d45c8b5aec6cf03f7bc177ecc1d2faea443d4e94475ac9312cdfde1a30b4e953356c7e93312eabd92ddb070cdcfb981ee5",
        "reserve": 1,
        "sec": "5KKw55iWFRmy614626Fo6ckzS7vxNcfhZJHvvo84W3cAzwfRjVo",
        "secret": "c703063648fd19d64de086064692dd17bd31ef4ebc8b8caa043d1fc7347d6a23"
    }

It almost looks like the first version was just cut off in the middle.

Another question: Is there any documentation about the various elements of the json that is produced with pywallet?

* For example what is the meaning of the "pool" array, its repeating all the addresses but without their keys but seems to contain additional info, what is the rationale behind structuring it that way and not just put all info about a key into one object?
* what is the empty ckey array at the beginning of the dump?


It indeed cut the private key in the middle because of a stupid error. Thank you so much for finding that. It's now fixed.

Json keys doc:
Quote
defaultkey: Default address of your wallet
keys: Info about the private keys in the wallet
pool: Addresses inside the pool (bitcoin doc for more info)
tx: Transactions saved inside your wallet
names: Labels of addresses
mkey: Info about the master key when the wallet is encrypted
ckey: Not used


Sir,
How it is possible from pywallet as following; please give me instruction & where i can change from pywallet. Which i will output:
    {
        "addr": "1EJP1Q1JEQdWtR5PEopCRZdE1F8dgk9Wwp",
        "compressed": false,
        "encrypted_privkey": "cb9f081748ed5d42d010b10baa84748535e5588908e6cc70a28c44c550277ecdcaaf0d5e36cc9f9 19a0cf3471d2832d8",
        "hexsec": "c703063648fd19d64de086064692dd17bd31ef4ebc8b8caa043d1fc7347d6a23",
        "pubkey": "0400481a16f118b4efe54b4783f857a9d45c8b5aec6cf03f7bc177ecc1d2faea443d4e94475ac93 12cdfde1a30b4e953356c7e93312eabd92ddb070cdcfb981ee5",
        "reserve": 1,
        "sec": "5KKw55iWFRmy614626Fo6ckzS7vxNcfhZJHvvo84W3cAzwfRjVo",
        "secret": "c703063648fd19d64de086064692dd17bd31ef4ebc8b8caa043d1fc7347d6a23"
    }

OR

    {
        "addr": "1EJP1Q1JEQdWtR5PEopCRZdE1F8dgk9Wwp",
        "compressed": false,
        "hexsec": "c703063648fd19d64de086064692dd17",
        "private": "308201130201010420c703063648fd19d64de086064692dd17bd31ef4ebc8b8caa043d1fc7347d6 a23a081a53081a2020101302c06072a8648ce3d0101022100ffffffffffffffffffffffffffffff fffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a0629 5ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b4 48a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03 bbfd25e8cd0364141020101a1440342000400481a16f118b4efe54b4783f857a9d45c8b5aec6cf0 3f7bc177ecc1d2faea443d4e94475ac9312cdfde1a30b4e953356c7e93312eabd92ddb070cdcfb9 81ee5",
        "pubkey": "0400481a16f118b4efe54b4783f857a9d45c8b5aec6cf03f7bc177ecc1d2faea443d4e94475ac93 12cdfde1a30b4e953356c7e93312eabd92ddb070cdcfb981ee5",
        "reserve": 1,
        "sec": "5KKw55iWFRmy614626Fo6ckzS7vxNcfhZJHvvo84W3cAzwfRjVo",
        "secret": "c703063648fd19d64de086064692dd17"
    }

However if it is not pywallet; please give me your script as following email id: ashraf.csr@gmail.com
Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!