Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clubedaentrega/cipher
Encrypt/decrypt data using AES-128-GCM easily
https://github.com/clubedaentrega/cipher
Last synced: about 1 month ago
JSON representation
Encrypt/decrypt data using AES-128-GCM easily
- Host: GitHub
- URL: https://github.com/clubedaentrega/cipher
- Owner: clubedaentrega
- License: mit
- Created: 2015-07-31T16:47:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-31T16:47:36.000Z (over 9 years ago)
- Last Synced: 2024-11-11T22:10:29.622Z (2 months ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @clubedaentrega/cipher
Encrypt/decrypt data using [AES-128-GCM](https://en.wikipedia.org/wiki/Galois/Counter_Mode) easily## Install
`npm install @clubedaentrega/cipher --save`## Usage
```js
// `key` is either a Buffer with 16 bytes or a hex-encoded-string
var key = ''
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)`