2.1.0 • Published 5 months ago

file-cipher v2.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

file-cipher

A simple file encryption and decryption utility for Node.js

Installation

npm install file-cipher

Usage

import { encrypt, decrypt } from "file-cipher";

// Encrypt from a file path
const encryptedFromFile = encrypt("./sensitive.txt", "mySecurePassword");

// Encrypt from a buffer
const fileBuffer = fs.readFileSync("./sensitive.txt");
const encryptedFromBuffer = encrypt(fileBuffer, "mySecurePassword");

// Decrypt from a file path
const decryptedFromFile = decrypt("./encrypted.bin", "mySecurePassword");

// Decrypt from a buffer
const encryptedBuffer = fs.readFileSync("./encrypted.bin");
const decryptedFromBuffer = decrypt(encryptedBuffer, "mySecurePassword");

API

  • encrypt(input: string | Buffer, password: string): Buffer
  • decrypt(input: string | Buffer, password: string): Buffer
2.1.0

5 months ago

2.0.0

6 months ago

1.8.0

6 months ago

1.7.0

6 months ago

1.6.0

6 months ago

1.4.0

6 months ago

1.3.0

6 months ago

1.2.0

6 months ago

1.1.0

6 months ago

1.0.0

6 months ago

0.1.0

10 years ago