An easy to use file encryption package for nodejs.
npm i soteria-fe
const fe = require("soteria-fe");
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});
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);
decrypt(file-path, password, options) returns a promise.
const fe = require("soteria-fe");
fe.decrypt(<file path>, <password>, options).then(() => { // Code goes here});
decryptSync(file-path, password, options) returns nothing.
const fe = require("soteria-fe");
fe.decryptSync(<file path>, <password>, options);
Name | Description |
---|---|
bytes | Specify the number of bytes to be used to make the salt. Default:- 16 |
algorithm | Specify the algorithm to encrypt/decrpyt a file. Default:- aes-192-cbc |
iv | Specify the Initialisation Vector. |
salt | Specify the salt to make the cipher. |
keylen | Specify the length(in bytes) of the key used to make cipher. Default: 24 |
length | Specify the length of iv. Default:- 16 |
outputPath | Specify the output file name. |