Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/sannjayy/node-encrypter
- Owner: sannjayy
- License: mit
- Created: 2023-11-17T11:57:41.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-17T13:08:27.000Z (about 1 year ago)
- Last Synced: 2024-09-18T20:25:33.697Z (4 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-encrypter
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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-encrypteryarn 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).