Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sannjayy/node-encrypter

Node Simple Encrypter Module for Encrypt and Decrypt Strings.
https://github.com/sannjayy/node-encrypter

Last synced: about 2 months ago
JSON representation

Node Simple Encrypter Module for Encrypt and Decrypt Strings.

Awesome Lists containing this project

README

        

# node-encrypter

npm simple module to easily encrypt and decrypt strings & passwords.

GitHub Repo: [https://github.com/sannjayy/node-encrypter](https://github.com/sannjayy/node-encrypter)

This module does not have any third-party dependencies.

## Install using npm / yarn

``` bash
npm install node-encrypter

yarn add node-encrypter
```

## Example usage encrypt and decrypt

```javascript
var Encrypter = require('node-encrypter');

const secretKey = "";
const encrypter = new Encrypter(secretKey);

const clearText = 'sanjaysikdar.dev';
const encryptedText = encrypter.encrypt(clearText);

const decryptedText = encrypter.decrypt(encryptedText);
```

## Advanced options
```javascript
const secretKey = "";
const algorithm = 'aes256';
const saltKeyLength = 32;
const digest = 'hex';

const encrypter = new Encrypter(secretKey, algorithm, saltKeyLength, digest);
```

- `secretKey` - secret string key used for encryption.
- `algorithm` - cipher Algorithm (default: aes256).
- `saltKeyLength` - length of salt key (default: 32).
- `digest` - message digest algorithm (default: hex).

---
[![](https://img.shields.io/github/followers/sannjayy?style=social)](https://github.com/sannjayy)
Developed by *Sanjay Sikdar*.
- 📫 [email protected]

## License

The Node Encrypter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).