Git Product home page Git Product logo

encrypter's Introduction

Encrypter

NodeJS encryption made easy.

npm version Build Status Quality

##Installation

The source is available for download from GitHub. Alternatively, you can install using Node Package Manager (npm):

npm install encrypter

##Usage

###initialize

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:

var encrypter = new (require('encrypter'))("myEncryptionSecret");

var encrypted = encrypter.encrypt('Hello from quorra!');

var decrypted = encrypter.decrypt(encrypted); // Hello from quorra!

With custom algorithms:

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.

encrypter's People

Contributors

harishanchu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

0xnbk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.