An open API service indexing awesome lists of open source software.

https://github.com/kessler/node-kessler-encryption

personal encryption utils
https://github.com/kessler/node-kessler-encryption

Last synced: 3 months ago
JSON representation

personal encryption utils

Awesome Lists containing this project

README

          

# @kessler/encryption

personal encryption utils

## Example

```js
const { encrypt, decrypt, createEncryptionKey, createRandomBytes } = require('@kessler/encryption')

const key = createEncryptionKey('secretpass', 'salt123')
const iv = new Buffer('9819u2nh2jksnbcjkbcsjksbcsscbskj')
const hmacKey = createRandomBytes()

const encryptedData = encrypt('kljiasojiojioqwennm,nmz,xcnm,zxcnkjlk', { key, iv, hmacKey })
const decryptedData = decrypt(encryptedData.data, { key, iv, hmacKey })
```