Last active
September 12, 2020 09:33
-
-
Save esneider/059a9aaef5284bb606758b4642e47c68 to your computer and use it in GitHub Desktop.
Transform an old copay Spanish mnemonic (with the composed unicode bug) into a seed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import hashlib | |
import unicodedata | |
if len(sys.argv) != 2: | |
print('Usage: python3 old-copay-spanish-mnemonic-to-seed.py "here go the mnemonic words"') | |
exit(1) | |
mnemonic = sys.argv[1] | |
composed = unicodedata.normalize('NFKC', mnemonic).encode('utf-8') | |
passphrase = 'mnemonic'.encode('utf-8') | |
stretched = hashlib.pbkdf2_hmac('sha512', composed, passphrase, 2048) | |
seed = stretched[:64] | |
print('seed: ' + seed.hex()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with:
python3 old-copay-spanish-mnemonic-to-seed.py "here go the mnemonic words"