file-aes-crypt

1.0.7 • Public • Published

file-crypt

A tool for encrypting or decrypting files using AES.

Install

npm i file-crypt --save
//or 
yarn add file-crypt

Example

const FileCrypt = require("file-aes-crypt");

async function test() {
  try {
    const fc = new FileCrypt("fage");
    let result = await fc.encrypt("package.json", "./tmp/package-aes.json");
    console.log("encrypt ok");
    result = await fc.decrypt("./tmp/package-aes.json", "./temp/package2.json");
    console.log("decrypt ok");
  } catch (e) {
    console.log(e);
  }
}

test().then((t) => {});

APIs

    /// encrypt file 
    /// @fileFrom=source file path
    /// @fileTo=dist encrypt file path
    encrypt(fileFrom:string, fileTo:string):Promise<void>;

    /// decrypt file 
    /// @fileFrom=source encrypt file path
    /// @fileTo=dist source file path
    decrypt(fileFrom:string, fileTo:string):Promise<void>;
    

Package Sidebar

Install

npm i file-aes-crypt

Weekly Downloads

2

Version

1.0.7

License

MIT

Unpacked Size

4.57 kB

Total Files

5

Last publish

Collaborators

  • lanmeng2022