New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

encryptouflage

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encryptouflage

This is a module, that can encrypt and decrypt messsages. (API Integration)

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

Encryptouflage

This is a module, that can encrypt and decrypt messsages.

About

With this module you can encrypt and decrypt any text message. This might be useful for encrypting Emails or Files in order to prevent third parties from monitoring the matter.

By default, the encrypted message is output in "lettered" format, camouflaging the message to automated email filters.

Usage

require the module

const encryptouflage = require('encryptouflage');

encrypt

encryptouflage.encrypt({ options })

options:

  • key
  • key / password desired to encrypt with
  • instream
  • readable stream of data, that is to be encrypted
  • outstream
  • writable stream, that the encrypted data is written to
  • algorithm (optional)
  • cipher algorithm used
    default: 'AES-256-CTR'
  • iv (optional)
  • initialization vector
    default crypto.randomBytes(16)
  • lettered (optional)
  • use "lettered" formatting
    default: true

example:

With lettered formatting
the initialization vector is added automatically.

const encryptouflage = require('./encryptouflage');
const fs = require('fs');

var input = fs.createReadStream('./input.txt');
var output = fs.createWriteStream('./output.encr');
var key = 'mysecretkey';

encryptouflage.encrypt({ instream: input, outstream: output, key: key });

With plain formatting
the initialization vector has to be handled manually.

const encryptouflage = require('./encryptouflage');
const fs = require('fs');

var input = fs.createReadStream('./input.txt');
var output = fs.createWriteStream('./output.encr');
var key = 'mysecretkey';

let iv = encryptouflage.encrypt({ instream: input, outstream: output, key: key, lettered: false });

output.on('close', function () {
  fs.appendFileSync(output.path, iv);
});

decrypt

encryptouflage.decrypt({ options })

options:

  • key
  • correct key / password to decrypt with
  • instream
  • readable stream of data, that is to be decrypted
  • outstream
  • writable stream, that the decrypted data is written to
  • iv
  • initialization vector
  • algorithm (optional)
  • cipher algorithm used
    default: 'AES-256-CTR'
  • lettered (optional)
  • use "lettered" formatting
    default: true

example:

With lettered formatting
the original initialization vector is extracted automatically and therefore not required.

const encryptouflage = require('./encryptouflage');
const fs = require('fs');

var input = fs.createReadStream('./input.encr');
var output = fs.createWriteStream('./output.txt');
var key = 'mysecretkey';

encryptouflage.decrypt({ instream: input, outstream: output, key: key});

With plain formatting
the original initialization cannot be extracted automatically and is therefore required.

const encryptouflage = require('./encryptouflage');
const fs = require('fs');

var input = fs.createReadStream('./input.encr');
var output = fs.createWriteStream('./output.txt');
var key = 'mysecretkey';
var iv = Buffer.from('qLhMmT0icQrCyTcyWaeT7g==', 'base64');

encryptouflage.decrypt({ instream: input, outstream: output, key: key, lettered: false, iv: iv });

License

Encryptouflage is MIT licensed. You can find out more and read the license document here.

Keywords

encryption

FAQs

Package last updated on 26 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts