Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quorrajs/encrypter
A very basic Node JS encryption - decryption module
https://github.com/quorrajs/encrypter
Last synced: about 2 months ago
JSON representation
A very basic Node JS encryption - decryption module
- Host: GitHub
- URL: https://github.com/quorrajs/encrypter
- Owner: quorrajs
- License: mit
- Created: 2015-04-16T11:42:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-16T05:41:03.000Z (about 8 years ago)
- Last Synced: 2024-11-29T18:18:46.382Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Encrypter
====NodeJS encryption made easy.
[![npm version](https://badge.fury.io/js/encrypter.svg)](http://badge.fury.io/js/encrypter)
[![Build Status](https://travis-ci.org/quorrajs/Encrypter.svg?branch=master)](https://travis-ci.org/quorrajs/Encrypter)
[![Quality](https://codeclimate.com/github/quorrajs/Encrypter/badges/gpa.svg)](https://codeclimate.com/github/quorrajs/Encrypter)##Installation
The source is available for download from [GitHub](https://github.com/quorrajs/Encrypter). Alternatively, you
can install using Node Package Manager (npm):```javascript
npm install encrypter
```##Usage
###initialize
```javascript
var encrypter = new (require('encrypter'))(encryptionKey[, cipherAlgorithm[, messageDigestAlgorithm]])
```
where`encryptionKey` - secret string key used for encryption
`cipherAlgorithm` - cipher Algorithm (default: `aes-256-ctr`).
Cipher algorithm is dependent on the available algorithms supported by the version of OpenSSL on the node platform. examples are 'aes192', etc. On recent releases, openssl list-cipher-algorithms will display the available cipher algorithms.
`messageDigestAlgorithm` - message digest algorithm(default: `sha1`).
Message digest algorithm is dependent on the available algorithms supported by the version of OpenSSL on the node platform. Examples are 'sha1', 'md5', 'sha256', 'sha512', etc. On recent releases, openssl list-message-digest-algorithms will display the available digest algorithms.
###encrypt and decrypt
With default algorithms:
```javascript
var encrypter = new (require('encrypter'))("myEncryptionSecret");var encrypted = encrypter.encrypt('Hello from quorra!');
var decrypted = encrypter.decrypt(encrypted); // Hello from quorra!
```With custom algorithms:
```javascript
var encrypter = new (require('encrypter'))("myEncryptionSecret", 'aes-256-ctc', 'sha256');var encrypted = encrypter.encrypt('Hello from quorra!');
var decrypted = encrypter.decrypt(encrypted); // Hello from quorra!
```##License
The Encrypter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).