@warren-bank/fcrypt

2.1.2 • Public • Published

fcrypt

fork of fcrypt v1.1.1

Library to store an input directory to an encrypted .zip file, and decrypt and extract an input encrypted .zip file to a directory.

Install

npm i "@warren-bank/fcrypt" --save

Node.js

var fcrypt = require("@warren-bank/fcrypt");

Encrypt

fcrypt.encrypt({
  key:    "mySuperPass1337",
  input:  "./src/private",
  output: "./dst/encrypted.zip.data",
  callback: (errors) => {
    if (errors.exists) {
      errors.console();
      return;
    }
    console.log("encrypted");
  }
});

Decrypt

fcrypt.decrypt({
  key:    "mySuperPass1337",
  input:  "./dst/encrypted.zip.data",
  output: "./dst/decrypted.zip",
  callback: (errors) => {
    if (errors.exists) {
      errors.console();
      return;
    }
    console.log("decrypted");
  }
});

Decrypt and Extract

fcrypt.extract({
  key:    "mySuperPass1337",
  input:  "./dst/encrypted.zip.data",
  output: "./dst/decrypted",
  callback: (errors) => {
    if (errors.exists) {
      errors.console();
      return;
    }
    console.log("extracted");
  }
});

Extra

You could change default crypto method

fcrypt.encrypt({
  method: "aes192", // HERE
  key:    "mySuperPass1337",
  input:  "./src/private",
  output: "./dst/encrypted.zip.data",
  callback: (errors) => {
    if (errors.exists) {
      errors.console();
      return;
    }
    console.log("encrypted");
  }
});

Same method parameter works for decrypt() and extract().

Readme

Keywords

none

Package Sidebar

Install

npm i @warren-bank/fcrypt

Weekly Downloads

0

Version

2.1.2

License

MIT

Unpacked Size

7.08 kB

Total Files

4

Last publish

Collaborators

  • warren-r-bank