1.0.1 • Published 1 year ago
nodejs-crypto-package v1.0.1
Node.js Crypto Package
A simple Node.js package that implements common cryptography functions.
Features
- Encrypts and decrypts messages using the AES-256-CBC algorithm
- Hashes messages using the SHA-256 algorithm
Installation
To install the package, run the following command:
- npm install nodejs-crypto-package
Usage
Here's an example of how to use the package in your code:
const crypto = require("nodejs-crypto-package");
const message = "secret message";
const password = "secret password";
// Encrypt the message
const encryptedMessage = crypto.encrypt(message, password);
console.log("Encrypted message:", encryptedMessage);
// Decrypt the message
const decryptedMessage = crypto.decrypt(encryptedMessage, password);
console.log("Decrypted message:", decryptedMessage);
// Hash the message
const hashedMessage = crypto.hash(message);
console.log("Hashed message:", hashedMessage);