1.0.1 • Published 3 years ago

soteria-fe v1.0.1

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

soteria-fe

An easy to use file encryption package for nodejs.

Installation

npm i soteria-fe 

Quick Start

const fe = require("soteria-fe");

Async Encryption

encrypt(file-path, password, options) returns a promise which resolves with an object containing the salt and iv used to encrypt the file.

const fe = require("soteria-fe");
fe.encrypt(<file path>, <password>, options).then(({ salt, iv }) => { // Code goes here});

Sync Encryption

encryptSync(file-path, password, options) returns an object containing the salt and iv used to encrypt the file.

const fe = require("soteria-fe");
const { salt, iv } = fe.encryptSync(<file path>, <password>, options);

Async Decryption

decrypt(file-path, password, options) returns a promise.

const fe = require("soteria-fe");
fe.decrypt(<file path>, <password>, options).then(() => { // Code goes here});

Sync Decryption

decryptSync(file-path, password, options) returns nothing.

const fe = require("soteria-fe");
fe.decryptSync(<file path>, <password>, options);

Options

NameDescription
bytesSpecify the number of bytes to be used to make the salt. Default:- 16
algorithmSpecify the algorithm to encrypt/decrpyt a file. Default:- aes-192-cbc
ivSpecify the Initialisation Vector.
saltSpecify the salt to make the cipher.
keylenSpecify the length(in bytes) of the key used to make cipher. Default: 24
lengthSpecify the length of iv. Default:- 16
outputPathSpecify the output file name.
1.0.1

3 years ago

1.0.0

3 years ago