4.0.5 • Published 5 years ago

clay-crypto v4.0.5

Weekly downloads
402
License
Apache-2.0
Repository
github
Last release
5 years ago

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

SignatureDescription
generate(bits) -> ArrayGenerate RSA key
sign(privateKey, text) -> stringCreate sign
stringify(value) -> stringStringify object
verify(publicKey, text, signature) -> booleanVerify text with signature

License

This software is released under the Apache-2.0 License.

Links

4.0.5

5 years ago

4.0.4

5 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

7 years ago