Giter Site home page Giter Site logo

brute_force_bip38's Introduction

brute_force_bip38

C++ implementation of the brute-force decoder of BIP38 encrypted private keys written by countzero/brute_force_bip38.

Build

./scripts/build.sh

Configuration

  1. Edit the config.txt with the publicAddressHex (in hex format) and the encryptedPrivateKey (BIP38 encoded private key) you know.
  2. Edit the secrets.txt file with all secrets you want to test.

Start

./build/brute_force_bip38

The application will now utilize all available CPUs to test each secret against your BIP38 encoded private key. If a valid secret has been found it will be logged out to valid_secret.txt.

Performance

Tested with 500-worst-passwords.txt on this computer:

CPUs	        Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz (4 x 2300)
GPU Status      2d_canvas: enabled
                checker_imaging: disabled_off
                flash_3d: enabled
                flash_stage3d: enabled
                flash_stage3d_baseline: enabled
                gpu_compositing: enabled
                multiple_raster_threads: enabled_on
                native_gpu_memory_buffers: enabled
                rasterization: enabled
                video_decode: enabled
                video_encode: enabled
                webgl: enabled
                webgl2: enabled
Load (avg)      8, 11, 8
Memory (System)	8.00GB (0.17GB free)
VM              0%

Results

implementation total processing time processing time per secret
C++ 337.219 seconds 0.675789 seconds (2x faster)
JS 755.20 seconds 1.51 seconds

brute_force_bip38's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

brute_force_bip38's Issues

Error with new version of libwally, non SSE / SSE4 capable hardware

I was able to get it libwally compiled, but now get the following error:

-- Configuring done
-- Generating done
-- Build files have been written to: /micNfs/tools/tmp/brute_force_bip38
Consolidate compiler generated dependencies of target secp256k1
[ 5%] Building C object third_party/libwally-core/CMakeFiles/secp256k1.dir/src/secp256k1/src/secp256k1.c.o
[ 11%] Linking C static library libsecp256k1.a
[ 11%] Built target secp256k1
Consolidate compiler generated dependencies of target libwally-core
[ 16%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/aes.c.o
[ 22%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/base58.c.o
[ 27%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/bip38.c.o
[ 33%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/hex.c.o
[ 38%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/hmac.c.o
[ 44%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/internal.c.o
[ 50%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/pbkdf2.c.o
[ 55%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/scrypt.c.o
In file included from /micNfs/tools/tmp/brute_force_bip38/third_party/libwally-core/src/scrypt.c:65:0:
/micNfs/tools/tmp/brute_force_bip38/third_party/libwally-core/src/scrypt/crypto_scrypt.c: In function '_crypto_scrypt':
/micNfs/tools/tmp/brute_force_bip38/third_party/libwally-core/src/scrypt/crypto_scrypt.c:99:15: warning: implicit declaration of function 'posix_memalign' [-Wimplicit-function-declaration]
if ((errno = posix_memalign(&B0, 64, 128 * r * p)) != 0) {
^
[ 61%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/sign.c.o
[ 66%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/ccan/ccan/crypto/ripemd160/ripemd160.c.o
[ 72%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/ccan/ccan/crypto/sha256/sha256.c.o
[ 77%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/ccan/ccan/crypto/sha512/sha512.c.o
[ 83%] Building C object third_party/libwally-core/CMakeFiles/libwally-core.dir/src/ccan/ccan/str/hex/hex.c.o
[ 88%] Linking C static library liblibwally-core.a
[ 88%] Built target libwally-core
Consolidate compiler generated dependencies of target brute_force_bip38
[ 94%] Building CXX object CMakeFiles/brute_force_bip38.dir/src/main.cpp.o
[100%] Linking CXX executable brute_force_bip38
CMakeFiles/brute_force_bip38.dir/src/main.cpp.o: In function brute38::bip38_public_key_from_private_key(std::string const&, std::string const&)': main.cpp:(.text+0x19e): undefined reference to bip38_to_private_key(char const*, unsigned char const*, unsigned long, unsigned int, unsigned char*, unsigned long)'
main.cpp:(.text+0x1bb): undefined reference to wally_ec_public_key_from_private_key(unsigned char const*, unsigned long, unsigned char*, unsigned long)' main.cpp:(.text+0x1d3): undefined reference to wally_hex_from_bytes(unsigned char const*, unsigned long, char**)'
collect2: error: ld returned 1 exit status
make[2]: *** [brute_force_bip38] Error 1
make[1]: *** [CMakeFiles/brute_force_bip38.dir/all] Error 2
make: *** [all] Error 2

I'm using a pretty old compiler because I don't have access to the fancy Intel compiler. If you have a moment, could you tell me if there is something I am missing here? I have been able to compile your tool on four other pieces of hardware without issue, but this system is very odd and I'm kind of stumped.

Was thinking possibly ABI related, however I've not been able to figure out how to set the ABI values to try setting them the same for libwally.

In this instance - libwally is at: 0.60 on my system, but had to disable all asm options due to weird architecture.

Mac OSX build error

When building on OSX Mojave this error appears:

`-- Configuring done
CMake Error at third_party/libwally-core/CMakeLists.txt:41 (add_library):
Cannot find source file:

src/secp256k1/src/secp256k1.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at third_party/libwally-core/CMakeLists.txt:5 (add_library):
Cannot find source file:

src/aes.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at third_party/libwally-core/CMakeLists.txt:41 (add_library):
No SOURCES given to target: secp256k1

CMake Error at third_party/libwally-core/CMakeLists.txt:5 (add_library):
No SOURCES given to target: libwally-core
`

MacOS Build Error

This is on a 2020 M1 Mac with macos 11.1:

`-- Configuring done
-- Generating done
-- Build files have been written to: /Users/davidv/Projects/brute_force_bip38/third_party/libwally-core
Building brute_force_bip38...
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/libwally-core/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/davidv/Projects/brute_force_bip38/build
[ 5%] Building C object third_party/libwally-core/CMakeFiles/secp256k1.dir/src/secp256k1/src/secp256k1.c.o
In file included from /Users/davidv/Projects/brute_force_bip38/third_party/libwally-core/src/secp256k1/src/secp256k1.c:9:
/Users/davidv/Projects/brute_force_bip38/third_party/libwally-core/src/secp256k1/src/util.h:11:10: fatal error: 'libsecp256k1-config.h' file not
found
#include "libsecp256k1-config.h"
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [third_party/libwally-core/CMakeFiles/secp256k1.dir/src/secp256k1/src/secp256k1.c.o] Error 1
make[1]: *** [third_party/libwally-core/CMakeFiles/secp256k1.dir/all] Error 2
make: *** [all] Error 2
Done.`

Installation or release exe version

Hi,
I have several days trying to compile your "brute_force_bip38" script; it was unable to compile. Please help to installation or release brute_force_bip38 file.

Regards,
Mohammad Ashraful Alam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.