Crypto Codecs

A project for encrypting and decrypting anything
Features
- Support for JWE (Json Web Encryption)
- Promise based interfaces
- Encrypting and Decrypting everything (number, string, boolean, array, date, regex, buffer, object)
Installation
npm install @adorsys/crypto-codecs
Usage
import { codecs, util } from 'crypto-codecs'
const { codecs, util } = require('../src')
codecs.jwe()
.then(codec => {
codec.encrypt({test: 42})
.then(cipher => codec.decrypt(cipher))
.then(value => value)
})
.catch(err => console.log(err))
let Key
util.jwk.generate()
.then(k => {
Key = k
return codecs.jwe({Key})
})
.then(codec => codec.encrypt({test: 42}))
.then(cipher => codecs.jwe({Key}).then(codec => codec.decrypt(cipher)))
.then(value => value)
.catch(err => console.log(err))
API
@adorsys/crypto-codecs
Credits
Made with :heart: by gradorsys and all these wonderful contributors (emoji key):
 Francis Pouatcha 🤔 | | | | | | |
---|
This project follows the all-contributors specification. Contributions of any kind are welcome!