trezor / python-mnemonic

:snake: Mnemonic code for generating deterministic keys, BIP39
https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
MIT License
843 stars 372 forks source link

seed = mnemo.to_seed(words, passphrase="") get error bad key length #96

Closed arlicle closed 2 years ago

arlicle commented 2 years ago

mnemo = Mnemonic("english") words = mnemo.generate(strength=256) seed = mnemo.to_seed(words, passphrase="")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/edison/Library/Python/3.8/lib/python/site-packages/mnemonic/mnemonic.py", line 239, in to_seed
    stretched = hashlib.pbkdf2_hmac(
ValueError: [digital envelope routines: CRYPTO_internal] bad key length
prusnak commented 2 years ago

Works for me here. Sounds like your installation is funky.

arlicle commented 2 years ago

My systerm is mac 12.1 (21C52)

prusnak commented 2 years ago

My systerm is mac 12.1 (21C52)

Works just fine with system Python 3.8.9 on macOS 12.3.

Try updating your OS to 12.3 if that helps.