clay-crypto

4.0.5 • Public • Published

clay-crypto

Build Status npm Version JS Standard

Cryptographic utility for Clay DB

Installation

$ npm install clay-crypto --save

Usage

'use strict'
 
const {
  generate,
  encrypt, decrypt 
= require('clay-crypto')
 
{
  const {publicKey, privateKey} = generate('', 2048)
  const encrypted = encrypt('This is the message', privateKey)
  const decrypted = decrypt(encrypted, publicKey)
 
  console.log(decrypted)
}
 

Functions

Available functions

Signature Description
generate(bits) -> Array Generate RSA key
sign(privateKey, text) -> string Create sign
stringify(value) -> string Stringify object
verify(publicKey, text, signature) -> boolean Verify text with signature

License

This software is released under the Apache-2.0 License.

Links

Readme

Keywords

Package Sidebar

Install

npm i clay-crypto

Weekly Downloads

20

Version

4.0.5

License

Apache-2.0

Unpacked Size

41.5 kB

Total Files

37

Last publish

Collaborators

  • okunishinishi
  • realglobe