Skip to content

Commit

Permalink
Version 0.2.211012 Chocolate ¡Beta! - Fixed the slow bP table generat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
albertobsd committed Oct 13, 2021
1 parent 4410516 commit 0d5c00d
Show file tree
Hide file tree
Showing 7 changed files with 489 additions and 364 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version 0.2.211012 Chocolate ¡Beta!
- Fixed the slow bP table generation.
-- This fix make obsolete the files keyhunt_bsgs_0_*.blm
-- please delete those files, please do:

```
rm keyhunt_bsgs_0_*.blm
```

- Added multi vanitysearch for address mode


# Version 0.2.211007 Chocolate ¡Beta!
- BSGS improvements:
-- 10x more Speed
Expand Down
189 changes: 180 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ and then execute with `-h` to see the help


## ¡Beta!
This version is still a beta version, there are a lot of things that can be fail. And absoluly there are some bugs
This version is still a *beta* version, there are a lot of things that can be fail. And absoluly there are some bugs

# Modes

Expand Down Expand Up @@ -144,6 +144,167 @@ output:
[+] Total 6291456 keys in 20 seconds: 314572 keys/s
```

### vanity search.

well this function always be there in the code but is not eficient, use only as a test and for fun, anyway if you want to search for a *vanity* address for you, you also *need* to search for some address at the same time this last is not optional, please feel free of use the VanitySearch
from Jean Luc Pons (https://github.com/JeanLucPons/VanitySearch) if you want a better speed.

Try to find all the unsolved puzzles at the same time while you search for a cool address for yourself.

Unsolved puzzles:

```
16jY7qLJnxb7CHZyqBP8qca9d51gAjyXQN
13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so
1BY8GQbnueYofwSuFAT3USAhGjPrkxDdW9
1MVDYgVaSN6iKKEsbzRUAYFrYJadLYZvvZ
19vkiEajfhuZ8bs8Zu2jgmC6oqZbWqhxhG
1PWo3JeB9jrGwfHDNpdGK54CRas7fsVzXU
1JTK7s9YVYywfm5XUH7RNhHJH1LshCaRFR
12VVRNPi4SJqUTsp6F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yoi1
1NevxKDYuDcCh1ZMMi6ftmWwGrZKC6j7Ux
19GpszRNUej5yYqxXoLnbZWKew3KdVLkXg
1M7ipcdYHey2Y5RZM34MBbpugghmjaV89P
18aNhurEAJsw6BAgtANpexk5ob1aGTwSeL
1FwZXt6EpRT7Fkndzv6K4b4DFoT4trbMrV
1CXvTzR6qv8wJ7eprzUKeWxyGcHwDYP1i2
1MUJSJYtGPVGkBCTqGspnxyHahpt5Te8jy
13Q84TNNvgcL3HJiqQPvyBb9m4hxjS3jkV
1LuUHyrQr8PKSvbcY1v1PiuGuqFjWpDumN
18192XpzzdDi2K11QVHR7td2HcPS6Qs5vg
1NgVmsCCJaKLzGyKLFJfVequnFW9ZvnMLN
1AoeP37TmHdFh8uN72fu9AqgtLrUwcv2wJ
1FTpAbQa4h8trvhQXjXnmNhqdiGBd1oraE
14JHoRAdmJg3XR4RjMDh6Wed6ft6hzbQe9
19z6waranEf8CcP8FqNgdwUe1QRxvUNKBG
14u4nA5sugaswb6SZgn5av2vuChdMnD9E5
1NBC8uXJy1GiJ6drkiZa1WuKn51ps7EPTv
```

To search only one vanity address is with `-v 1Hunter1` where `1Good1` is the vanity addres that are you looking for:

full command
```
./keyhunt -m address -f tests/unsolvedpuzzles.txt -l compress -R -b 256 -v 1Good
```

output:

```
[+] Version 0.2.211012 Chocolate ¡Beta!, developed by AlbertoBSD
[+] Mode address
[+] Search compress only
[+] Random mode
[+] Added Vanity search : 1Good
[+] Opening file tests/unsolvedpuzzles.txt
[+] Setting search for btc adddress
[+] Allocating memory for 86 elements: 0.00 MB
[+] Bloom filter for 86 elements.
[+] Loading data to the bloomfilter total: 0.00 MB
[+] Bloomfilter completed
[+] Sorting data ... done! 86 values were loaded and sorted
Base key: bc850706b582fe5dba5c4e10b62af4872bfbf87018986f4bXXXXXXXXXXXXXXXX
Vanity privKey: bc850706b582fe5dba5c4e10b62af4872bfbf87018986f4bXXXXXXXXXXXXXXXX
Address compressed: 1Goodj7J2nYETeiYM3uxRvekfC3VkpsCfM
```

challenge your self and use keythunt and find the privatekeys for this address `1Goodj7J2nYETeiYM3uxRvekfC3VkpsCfM`

publickey:

```
03dd178097fef876f59f6f5d3c384bab8e824f116c864cd552edbf420a8e157d88
```

command to search multiple vanity address from a file `-V filename.txt` please note that it is `-V` Capital V for read a file.

```
./keyhunt -m address -f tests/unsolvedpuzzles.txt -l compress -R -b 256 -V tests/vanitytargets.txt
```

Output:
```
[+] Version 0.2.211012 Chocolate ¡Beta!, developed by AlbertoBSD
[+] Mode address
[+] Search compress only
[+] Random mode
[+] Added Vanity file : tests/vanitytargets.txt
[D] Added Vanity search : 1GoodBoy
[D] Added Vanity search : 1BadBoy
[+] Opening file tests/unsolvedpuzzles.txt
[+] Setting search for btc adddress
[+] Allocating memory for 86 elements: 0.00 MB
[+] Bloom filter for 86 elements.
[+] Loading data to the bloomfilter total: 0.00 MB
[+] Bloomfilter completed
[+] Sorting data ... done! 86 values were loaded and sorted
Base key: c0a082112714d9f4dba8bf07adb9bc2204c594b5c24270b0cb9a8ff6c2adc9c3
```

All the vanity address and his privatekeys will be saved in the file `vanitykeys.txt` of your current directory


## rmd160 mode

rmd stand for RIPE Message Digest (see https://en.wikipedia.org/wiki/RIPEMD )
Expand Down Expand Up @@ -400,7 +561,9 @@ The input file need to have a list of publickeys compress or uncompress those pu
046534b9e9d56624f5850198f6ac462f482fec8a60262728ee79a91cac1d60f8d6a92d5131a20f78e26726a63d212158b20b14c3025ebb9968c890c4bab90bfc69 # 0000000000000000000000000000000000800000000000000000200000000000
```

This example contains 2 publickeys followed by his privatekey just to test the correct behavior of the application
This example contains 2 publickeys followed by his privatekey just to test the correct behavior of the application.

*Don't load more than 100 or 1000 publickeys* if you lad more than it will take a long long time in update the speed counter and the speed will be very low.

btw any word followed by and space after the publickey is ignored the file can be only the publickeys:

Expand Down Expand Up @@ -783,7 +946,6 @@ To get optimal performance the k values need to be base 2^x values, this is 1,2,

### Valid n and k values

```
+---------------------------+-------------+---------------------------+
| bits | n in hexadecimal | k max value | Amount of RAM with k = 1 |
+---------------------------+-------------+---------------------------+
Expand All @@ -810,9 +972,9 @@ To get optimal performance the k values need to be base 2^x values, this is 1,2,
| 60 | 0x1000000000000000 | 1048576 | ~4.5 GB |
| 62 | 0x4000000000000000 | 2097152 | ~9 GB |
+---------------------------+-------------+---------------------------+
```

if you exceed the Max value of K the program can have a unknow behavior, the program can have a suboptimal performance, or in the wrong case you can missing some hits.
*if you exceed the Max value of K the program can have a unknow behavior, the program can have a suboptimal performance, or in the wrong cases you can missing some hits and have an incorrect SPEED.*

Of course you can use a bigger number N like 2^64 or 2^70 if you have enough memory for it.

Expand Down Expand Up @@ -887,14 +1049,23 @@ sys 0m13.009s
- Where the privatekeys will be saved?
R: In a file called `KEYFOUNDKEYFOUND.txt`

- Why the speed for bsgs say 0 keys/s
R: this was asked here https://github.com/albertobsd/keyhunt/issues/69 and here https://github.com/albertobsd/keyhunt/issues/108 and also others in telegram

Please check the video that i made to answer that https://youtu.be/MVby8mYNxbI

- Is available for Windows?
R: It can be compiled with mingw, It can be executed in the Ubuntu shell for windows 10
Updated: Yes, thanks to @WanderingPhilosopher
Available in: https://github.com/WanderingPhilosopher/keyhunt/releases/tag/v1.0
R: It can be compiled with mingw, also it can be executed in the Ubuntu shell for windows 10
Updated:
Yes, thanks to @WanderingPhilosopher
Available in: https://github.com/WanderingPhilosopher/keyhunt

Also thanks to @XopMC
Available in: https://github.com/XopMC/keyhunt-win

- Why i need the bPfile.bin ?
R: Usually you don't need it, but if you are going to run and stop the program several times is faster load the data from a file.
NOTE: bPfile.bin will discontinued in some future version, the current versios have the `-S` to SAVE the FILES or READ from IT if they already exist
NOTE: *bPfile.bin will discontinued in some future version, the current versios have the `-S` to SAVE the FILES or READ from IT if they already exist*

- The bPfile gives me extra speed?
R: No, is just to help to speed up a little the load process and no more, but the final speed of keys per second is going to be the same without this file.
Expand Down
23 changes: 12 additions & 11 deletions bloom/bloom.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@
#define BLOOM_VERSION_MAJOR 2
#define BLOOM_VERSION_MINOR 200

inline static int test_bit_set_bit(unsigned char * buf, uint64_t bit, int set_bit)
inline static int test_bit_set_bit(struct bloom * bloom, uint64_t bit, int set_bit)
{
uint64_t byte = bit >> 3;
uint8_t c = buf[byte]; // expensive memory access
uint8_t c;
uint8_t mask = 1 << (bit % 8);
pthread_mutex_lock(&bloom->mutex);
c = bloom->bf[byte]; // expensive memory access
pthread_mutex_unlock(&bloom->mutex);
if (c & mask) {
return 1;
} else {
if (set_bit) {
buf[byte] = c | mask;
pthread_mutex_lock(&bloom->mutex);
bloom->bf[byte] = c | mask;
pthread_mutex_unlock(&bloom->mutex);
}
return 0;
}
Expand All @@ -58,9 +63,12 @@ static int bloom_check_add(struct bloom * bloom, const void * buffer, int len, i
uint64_t b = XXH64(buffer, len, a);
uint64_t x;
uint8_t i;
int r;
for (i = 0; i < bloom->hashes; i++) {
x = (a + b*i) % bloom->bits;
if (test_bit_set_bit(bloom->bf, x, add)) {
r = test_bit_set_bit(bloom, x, add);

if (r) {
hits++;
} else if (!add) {
// Don't care about the presence of all the bits. Just our own.
Expand Down Expand Up @@ -106,11 +114,6 @@ int bloom_init2(struct bloom * bloom, uint64_t entries, long double error)

bloom->hashes = (uint8_t)ceil(0.693147180559945 * bloom->bpe); // ln(2)

/*
printf("\nBPE: %lu\n",bloom->bpe);
printf("BITS: %lu\n",bloom->bits);
printf("BYTES: %lu\n",bloom->bytes);
*/
bloom->bf = (uint8_t *)calloc(bloom->bytes, sizeof(uint8_t));
if (bloom->bf == NULL) { // LCOV_EXCL_START
return 1;
Expand Down Expand Up @@ -168,9 +171,7 @@ int bloom_check(struct bloom * bloom, const void * buffer, int len)
int bloom_add(struct bloom * bloom, const void * buffer, int len)
{
int r;
pthread_mutex_lock(&bloom->mutex);
r =bloom_check_add(bloom, buffer, len, 1);
pthread_mutex_unlock(&bloom->mutex);
return r;
}

Expand Down
Loading

0 comments on commit 0d5c00d

Please sign in to comment.