Skip to content
/ BIP38 Public

A Java implementation of the BIP-0038 draft for encryption of Bitcoin keys

Notifications You must be signed in to change notification settings

dbasch/BIP38

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

BIP38

A Java implementation of the BIP-0038 Draft: Passphrase-protected private key for Bitcoin.

Usage

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.

Example

Key generation:

generateEncryptedKey("hello")

might produce

6PgMiWeAFVWrLUohAiM5YdtGjaZwaHGoLH6oaUysnkt6XuQS7VXcRmmuWs

Decryption:

decrypt(hello, "6PgMiWeAFVWrLUohAiM5YdtGjaZwaHGoLH6oaUysnkt6XuQS7VXcRmmuWs")

will result in

5JtA62jW9F38PU4T116PE6rfmz3b2X2auLWWHKfCyzzWdqEP8qB

which corresponds to address

1hE5eAbTrqEJZHLP8J1Eje5HHJU9aHVrj

To do

  • implement the remaining functionality from the spec.
  • write more tests.

Note for OSX

If you get an exception about an illegal key size, you probably need to install the Unlimited Strength Jurisdiction Policy Files

Tips

If you find this useful, tips are welcome :)

1EmwBbfgH7BPMoCpcFzyzgAN9Ya7jm8L1Z

License

Copyright © 2014 Diego Basch

Licensed under the Apache 2.0 License

About

A Java implementation of the BIP-0038 draft for encryption of Bitcoin keys

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages