1.1.2 • Published 5 years ago

fcrypt v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

fcrypt

v1.1.1 ( last update: 27 may 2017 )

Encryption and decryption files and folders.

Install

npm i fcrypt --save-dev

Node.js

var fcrypt = require("fcrypt");

Encrypt

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

Decrypt

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

Extra

You could change default crypto method

fcrypt.encrypt({
  key: "mySuperPass1337",
  input: "./private",
  output: "./dest/private.data",
  method: "aes192", // <-- The one
  callback: () => {
    console.log("encrypted");
  }
});

Same thing in decrypt()