Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from algosdk import wordlist, mnemonic
- from base64 import *
- from nacl.signing import SigningKey
- from time import time
- word_lookup = wordlist.word_list_raw().split('\n')[0:2048]
- def countup(bytes):
- i = 31
- while True:
- if bytes[i] != 255:
- bytes[i] += 1
- return bytes
- bytes[i] = 0
- i = i-1
- actual_key = "require pizza romance quality asthma turtle tent obey address bless include scan table scrub rude fit shoe such trophy wheat ridge squirrel lab able festival"
- truncated_key = "require pizza romance quality asthma turtle tent obey address bless include scan table scrub rude fit shoe such trophy wheat ridge squirrel"
- address = "N4AMYWLZQQTITC7NYPY4N7K32AUCM3BP5DECD4SMWRU2OISXBTLDIPWVF4"
- print(f'Actual key: {actual_key}')
- print(f'Truncated key: {truncated_key}')
- start_time = time()
- mm = truncated_key.split(' ')
- while len(mm) < 24:
- mm.append(word_lookup[0])
- words = mnemonic._from_words(mm)
- bits = bytearray(mnemonic._to_bytes(words)[:32])
- print(address)
- num_tested = 0
- while True:
- privkey = SigningKey(bytes(bits))
- pubkey = privkey.verify_key
- if b32encode(pubkey.encode())[:32] == address[:32].encode():
- print(f'found key: {mnemonic._from_key(bits)}')
- print(f'Took: {time() - start_time:.1f}s')
- break
- bits = countup(bits)
- num_tested += 1
- if num_tested % 10000 == 0:
- print(f'Tested {num_tested} keys in {time() - start_time:.1f}s')
Add Comment
Please, Sign In to add comment