-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f2479e5
Showing
4 changed files
with
472 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# BIP38 | ||
|
||
A Java implementation of the BIP-0038 Draft: [Passphrase-protected private key](https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki) for Bitcoin. | ||
|
||
## Usage | ||
|
||
`BIP38.encryptEC(password, lot, sequence)` generates an encrypted key starting with 6P. | ||
If you don't care about lot/sequence (if you don't know what they are, you don't care), | ||
just use -1 for the lot. That will cause those parameters to be ignored. | ||
|
||
`BIP38.decrypt(password, encrypted key)` yields the decrypted get. | ||
|
||
Currently only encryptEC and decryptEC have been tested (and barely). | ||
|
||
## Example: | ||
|
||
Key generation: | ||
|
||
`encrypt("hello", -1, -1)` | ||
|
||
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 (e.g. generate compressed keys) | ||
* write some tests. | ||
* make the code cleaner. | ||
|
||
## Tips | ||
|
||
If you find this useful, tips are welcome :) | ||
|
||
**1EmwBbfgH7BPMoCpcFzyzgAN9Ya7jm8L1Z** | ||
|
||
## License | ||
|
||
Copyright © 2014 Diego Basch | ||
|
||
Licensed under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url "http://distribution.bitcoinj.googlecode.com/git/releases/" | ||
} | ||
} | ||
|
||
|
||
dependencies { | ||
compile 'com.madgag:scprov-jdk15on:1.47.0.3' | ||
compile 'com.google.guava:guava:15.0' | ||
compile 'com.google:bitcoinj:0.10.3' | ||
compile 'org.bouncycastle:bcprov-jdk16:1.46' | ||
} | ||
|
||
apply plugin:'application' | ||
mainClassName = 'com.fruitcat.bitcoin.BIP38' |
Oops, something went wrong.