Coder Social home page Coder Social logo

bip38's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.