A Java implementation of the BIP-0038 Draft: Passphrase-protected private key for Bitcoin.
BIP38.generateEncryptedKey(password)
generates an encrypted key starting with "6P".
BIP38.encryptNoEC(password, encodedKey, isCompressed)
encrypts a known key.
BIP38.decrypt(password, encryptedKey)
yields the decrypted get.
Key generation:
generateEncryptedKey("hello")
might produce
6PgMiWeAFVWrLUohAiM5YdtGjaZwaHGoLH6oaUysnkt6XuQS7VXcRmmuWs
Decryption:
decrypt(hello, "6PgMiWeAFVWrLUohAiM5YdtGjaZwaHGoLH6oaUysnkt6XuQS7VXcRmmuWs")
will result in
5JtA62jW9F38PU4T116PE6rfmz3b2X2auLWWHKfCyzzWdqEP8qB
which corresponds to address
1hE5eAbTrqEJZHLP8J1Eje5HHJU9aHVrj
- implement the remaining functionality from the spec.
- write more tests.
If you get an exception about an illegal key size, you probably need to install the Unlimited Strength Jurisdiction Policy Files
If you find this useful, tips are welcome :)
1EmwBbfgH7BPMoCpcFzyzgAN9Ya7jm8L1Z
Copyright © 2014 Diego Basch
Licensed under the Apache 2.0 License