simple-node-encryption

1.0.0 • Public • Published

simple-node-encryption

This module uses nodes core crypto module into a simple encryption service.

Usage

Example usage:

var encryption = require('simple-node-encryption')
var algorithm = 'aes-256-cbc'
var iv = new Buffer(16).fill(0) // Make this random in real life.
var encryptionKey = '12345678901234567890123456789012'

var encryptionService = encryption(algorithm, iv)

var encrypted = encryptionService.encrypt('stringOrBufferToEncrypt', encryptionKey)
var decrypted = encryptionService.decrypt(encrypted, encryptionKey).toString('utf8')

Testing

Run npm test to run tests. Currently tested and supported encryption algorithms are:

aes-128-cbc
aes-128-ecb
aes-192-cbc
aes-192-ecb
aes-256-cbc    
aes-256-ecb

Run openssl list-cipher-algorithms to list all possible cipher algorithms.

Readme

Keywords

Package Sidebar

Install

npm i simple-node-encryption

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • jaakkol