Socket
Socket
Sign inDemoInstall

hivecrypt

Package Overview
Dependencies
20
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hivecrypt

A small JavaScript module for Hive memo encryption and decryption


Version published
Weekly downloads
22
increased by29.41%
Maintainers
1
Install size
4.71 MB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 20 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc