1.0.3 • Published 4 years ago

encryption-se v1.0.3

Weekly downloads
4
License
MIT
Repository
bitbucket
Last release
4 years ago

Encryption SE

NPM Version NPM Downloads Install Size CircleCI Coverage Status

Description

A simple module wrapping around NodeJS Crypto module allowing handling IV by prefixing it to encrypted string.

Options

NameDefaultDescription
passwordnullPassword secret REQUIRED
passwordSaltThis is my salt 362Password salt
iterationCount100000Number of iterations for PBKDF2
encryptionKeynullEncryption key as array of bytes

How to use it

Installation

// First you have to get module and instantiate it

npm install encryption-se

OR

yarn add encryption-se

After installing module, add this to your code:

const options = {
  password: process.env.encryptionPassword || 'SomePassword'
};

const encryption = require('encryption-se')(options);

How to encrypt?

encryption
  .encrypt('This is to be encrypted')
  .then(enc => {
    // 'enc' contains encrypted string in base64 format
  })
  .catch((err) => {
    // This is to handle errors
  })

How to decrypt?

encryption
  .decrypt('iQ6qlRWlwWXtmGPFbBiEc4WKKAbHCLQK0+HLxoGLKY0=')
  .then((text) => {
    // 'text' contains decrypted string
  })
  .catch((err) => {
    // This is to handle errors
  })

Contact

Image

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.1

6 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago