crypto-props
Encrypt/decrypt values from given properties of an object
Usage
const code = require('crypto-props')
const data = {
id: 123456,
text: 'Så vakker var aldri natten'
}
const encryptOptions = {
secret: 'Louie Louie oh no I got to go Louie Louie oh no I got to go',
data: data,
method: 'encrypt'
}
const encrypted = code(encryptOptions)
console.log(encrypted)
const decryptOptions = {
secret: 'Louie Louie oh no I got to go',
data: encrypted,
method: 'decrypt'
}
const decrypted = code(decryptOptions)
console.log(decrypted)
API
const options = {
secret: 'string'
data: {object}
method: 'string'
exclude: [array]
include: [array]
}
License
MIT