# file-encryptor

> Encrypts files using Node's built-in Cipher class.

Latest version **0.1.1** (published 2016-04-18) · 0 weekly downloads

## Install

```sh
npm install file-encryptor
pnpm add file-encryptor
yarn add file-encryptor
bun add file-encryptor
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-04-18 |
| First published | 2013-01-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45 |
| Author | Modulus |
| Maintainers | inconceivableduck, jackboberg, tzmanics |

## Links

- npm: https://www.npmjs.com/package/file-encryptor
- Repository: https://github.com/onmodulus/file-encryptor
- Issues: https://github.com/onmodulus/file-encryptor/issues
- npm.io page: https://npm.io/package/file-encryptor

## Recent versions

- 0.1.1 (latest) — 2016-04-18
- 0.1.0 — 2013-01-18

## README

# file-encryptor

Encrypts files using Node's built-in Cipher class. Encryption is stream-based for low memory footprint.

## Getting Started

Install the module:

    npm install file-encryptor

Use it in your script:

    var encryptor = require('file-encryptor');

    var key = 'My Super Secret Key';

    // Encrypt file.
    encryptor.encryptFile('input_file.txt', 'encrypted.dat', key, function(err) {
      // Encryption complete.
    });

    ...

    // Decrypt file.
    encryptor.decryptFile('encrypted.dat', 'output_file.txt', key, function(err) {
      // Decryption complete.
    });

The input file will be streamed through the Cipher and to the output file. If the output files does not
exists, it will be created. If the output file already exists, it will be truncated.

## Change Cipher Algorithm

By default the "aes192" cipher algorithm is used. This can be changed by passing a new algorithm string
as an option.

Available algorithms can be found by executing:

    openssl list-cipher-algorithms

Setting algorithm option:

    var key = 'My Super Secret Key';
    var options = { algorithm: 'aes256' };

    encryptor.encryptFile('input_file.txt', 'encrypted.dat', key, options, function(err) {
      // Decryption complete;
    });

    ...

    encryptor.decryptFile('encrypted.dat', 'outputfile.txt', key, options, function(err) {
      // Encryption complete;
    });

## License
Copyright (c) 2013 Modulus
Licensed under the MIT license.

---
_Source: https://npm.io/package/file-encryptor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
