Open ghost opened 11 years ago
I have code for this now (BIP38) and it also handles a bunch of other simpler private key formats with auto-detect. Any interest, @richardkiss? It's one file.
Sure, do a pull request. Is it pure python?
Yes, pure python, but requires "scrypt" module.
@peter-conalgo, were you ever able to submit a PR for this? If not, please let me know if I can be of any assistance. I would love to see this feature added as well.
Never made a PR for this no, so I'm going to have another coder here look at doing this shortly.
If you need a pure Python AES implementation, I've found a few, but haven't explored any of them in detail:
I'm assuming based on @richardkiss's question that creating a dependency on pyopenssl or cryptography (like /zimage/python-bitcoinlib/.../bitcoin/bip38.py uses) is less than ideal...?
Also, it might be too new, but as of Python 2.7.8 and 3.4, the hashlib
standard module has a PBKDF2 implementation. Otherwise, there's an external pure Python library (which is also used by Trezor's BIP0032 implementation).
Please consider adding BIP0038 support:
Here is a reference implementation in Python jgarzik/python-bitcoinlib#5
which is specifically this file adding the library: https://github.com/zimage/python-bitcoinlib/blob/e9506aba6d53ad5bf760d67815d711a1c55b2557/bitcoin/bip38.py