Skip to content

clubedaentrega/cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@clubedaentrega/cipher

Encrypt/decrypt data using AES-128-GCM easily

Install

npm install @clubedaentrega/cipher --save

Usage

// `key` is either a Buffer with 16 bytes or a hex-encoded-string
var key = '<a 128 bit key = 32 hex-chars>'
var cipher = require('@clubedaentrega/cipher')(key)

var cipherText = cipher.encrypt('some data')

var plainText = cipher.decrypt(cipherText) // 'some data'
var invalid = cipher.decrypt('invalid cipher text') // undefined

Create your encryption key with something like crypto.randomBytes(16)

About

Encrypt/decrypt data using AES-128-GCM easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published