kiss-crypto
TypeScript icon, indicating that this package has built-in type declarations

0.3.0-beta.0 • Public • Published

kiss-crypto

Easily encrypt and decrypt messages. All the complexity is hidden behind the scenes.

Usage

import {encrypt, decrypt, generateEncryptionKey} from 'kiss-crypto'

const key = await generateEncryptionKey()

const plaintext = 'hello world'

const ciphertext = await encrypt({
  plaintext,
  key,
})

const decrypted = await decrypt({
  ciphertext,
  key,
})

expect(decrypted).toEqual(plaintext)

And to turn passwords into encryption keys

const password = 'password1'
const salt = await generateSalt()
const hash = await hashPassword({password, salt})

expect(hash.length).toEqual(512)

Readme

Keywords

none

Package Sidebar

Install

npm i kiss-crypto

Weekly Downloads

254

Version

0.3.0-beta.0

License

MIT

Unpacked Size

13.9 kB

Total Files

14

Last publish

Collaborators

  • maccman