Skip to content

Instantly share code, notes, and snippets.

@iWarpBTC
Created December 15, 2022 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iWarpBTC/6b06ff18c28c97fc7f2dc9a05b3cca81 to your computer and use it in GitHub Desktop.
Save iWarpBTC/6b06ff18c28c97fc7f2dc9a05b3cca81 to your computer and use it in GitHub Desktop.
Free corn extractor
import hashlib
from binascii import unhexlify
import mnemonic
from bip32 import BIP32
import base58
if __name__ == '__main__':
# nacteni wordlistu do listu
with open("english.txt", "r", encoding="utf-8") as f:
wordlist = [w.strip() for w in f.readlines()]
wordlist.reverse()
konec = False
for pate in wordlist:
for sestnacte in wordlist:
for posledni in range(0,8):
seed = ['danger', 'slow', 'cluster', 'tool', pate, 'ozone', 'mention', 'elbow', 'slight', 'flavor', 'brown', 'copy', 'now', 'forward', 'feed', sestnacte, 'shoulder', 'violin', 'soccer', 'electric', 'dolphin', 'choose', 'change']
# slova na pocatecni entropy
entropy = ''
for slovo in seed:
entropy += bin(2047 - wordlist.index(slovo))[2:].zfill(11)
entropy += bin(posledni)[2:].zfill(3)
int_ent = int(entropy, 2)
# prevedeme na hexa retezec
hex_str_entropy = unhexlify(hex(int_ent)[2:].zfill(64))
# zahashujeme
check = hashlib.sha256(hex_str_entropy).hexdigest()
# pripojime 8 bity na konec entropie
b = bin(int_ent)[2:].zfill(256) + bin(int(check, 16))[2:].zfill(256)[:8]
# zpatky na slova
result = []
for i in range(len(b) // 11):
idx = int(b[i * 11 : (i + 1) * 11], 2)
result.append(wordlist[2047-idx])
result_phrase = " ".join(result)
print(result_phrase)
seed = mnemonic.Mnemonic('english').to_seed(result_phrase, "")
bip32 = BIP32.from_seed(seed, network="main")
xpub = bip32.get_xpub_from_path("m/0")
xfp = base58.b58decode_check(xpub).hex()[10:18]
if xfp == '1efd69d6':
print('vitez')
print(result_phrase)
konec = True
break
if konec:
break
if konec:
break
print('konec')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment