Modifying Code for 24-Word Mnemonics

3 replies 447 views
ape69Member
Posts: 1 · Reputation: 195
#1Sep 21, 2020, 09:54 AM
Hey, I’m not really into programming, so I can't help much with changing the code. But if you wanna brute-force those 24 BIP39 words, check out BTCRecover. It's getting updates and supports GPUs.
8 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#2Sep 23, 2020, 03:13 PM
To handle longer mnemonics, you gotta bump up the block size in HMAC from 128 bits to 256 bits. A 24-word mnemonic is over 128 bytes, so the current setup won't cut it. You’ll need to change a lot in the code, especially in those int_to_address.cl and just_seed.cl files since they’re set for 12 words.
1 Reply Quote Share
m1kes4tFull Member
Posts: 167 · Reputation: 252
#3Sep 23, 2020, 09:05 PM
I saw what mcdouglasx said and took it as a challenge. So, check this out: I made the ipad_key and opad_key arrays 128 bytes for HMAC. When the mnemonic is longer than 128 bytes (like with 24 words), the extra key part isn’t handled right. We need a key normalization process for HMAC. If the key is bigger than 128 bytes for SHA-512, it should be hashed down, then padded to 128 bytes if it’s short.
0 Reply Quote Share
0xNovaFull Member
Posts: 123 · Reputation: 597
#4Sep 24, 2020, 12:07 AM
+1 to the key normalization idea. Sounds smart. But this seems like a huge code overhaul. Is it even worth it? Just curious, are you sure about the hashing bit? Seems like a lot of work for just a mnemonic.
3 Reply Quote Share

Related topics