2.0.9 • Published 4 months ago

hivecrypt v2.0.9

Weekly downloads
5
License
MIT
Repository
github
Last release
4 months ago

Hivecrypt

A small JavaScript module for Hive memo encryption and decryption.

Adapted from this pull request that was never merged into dhive. Implemented using Crypto-JS such that it is compatible with all JavaScript environments including Electron JS apps.

Why was this created?

I needed a way to encrypt and decrypt messages using Hive posting keys in Electron apps, however the methods provided by hive-js are not supported in those environments due to the usage of libraries that are only available in Node JS and browsers natively.

Installation

Node JS

npm i hivecrypt

Then import it as a module with const hivecrypt = require('hivecrypt').

Browser

Include in HTML:

<script src="https://unpkg.com/hivecrypt/bin/hivecrypt.min.js"></script>

The Hivecrypt methods will be accessible through window.hivecrypt.

Usage

Encrypt a memo

let encrypted = hivecrypt.encode('5Jprivatekey1','STMpublickey2','#messageToEncrypt')
console.log(encrypted)

Decrypt a memo

let decrypted = hivecrypt.decode('5privatekey','#encryptedMessage')
console.log(decrypted)

Generate a random WIF-encoded private key

let randomWif = hivecrypt.randomWif()
console.log(randomWif) // 5JBBPcSkrsvmAmvmex9aC4NNGvZsU87eePzpbFpD9PZRtgGoBKh
2.0.7

4 months ago

2.0.9

4 months ago

2.0.8

4 months ago

2.0.5

2 years ago

2.0.6

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago