https://github.com/mrvsik/soteria-fe
Package designed to encrypt and decrypt files easily
https://github.com/mrvsik/soteria-fe
crypto-js nodejs npm-package typescript
Last synced: 3 months ago
JSON representation
Package designed to encrypt and decrypt files easily
- Host: GitHub
- URL: https://github.com/mrvsik/soteria-fe
- Owner: MrVSiK
- License: mit
- Created: 2021-09-16T07:25:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-15T11:06:08.000Z (over 3 years ago)
- Last Synced: 2025-01-26T05:15:23.195Z (3 months ago)
- Topics: crypto-js, nodejs, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/soteria-fe
- Size: 117 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# soteria-fe
An easy to use file encryption package for nodejs.## Installation
```bash
npm i soteria-fe
```## Quick Start
```js
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.
```js
const fe = require("soteria-fe");
fe.encrypt(, , 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.
```js
const fe = require("soteria-fe");
const { salt, iv } = fe.encryptSync(, , options);
```
## Async Decryption
**decrypt(file-path, password, options)** returns a **promise**.
```js
const fe = require("soteria-fe");
fe.decrypt(, , options).then(() => { // Code goes here});
```
## Sync Decryption
**decryptSync(file-path, password, options)** returns nothing.
```js
const fe = require("soteria-fe");
fe.decryptSync(, , options);
```## 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. |