Random Password Generator with AES Encryption and Decryption using Node crypto module
Random Password Generator helps create strong passwords to enhance security, while AES encryption is a robust algorithm used to secure data by transforming it into ciphertext, rendering it unreadable without the appropriate decryption key.
Installing
Using npm:
$ npm install @eternaljs/password-generator
Using yarn:
$ yarn add @eternaljs/password-generator
Usage
These examples assume you're in node, or something similar:
const {
generateRandomPassword,
generateSecretAndSalt,
encryptPassword,
decryptPassword,
} = require("@eternaljs/password-generator");
import {
generateRandomPassword,
generateSecretAndSalt,
encryptPassword,
decryptPassword,
} from "@eternaljs/password-generator";
const genPassword = generateRandomPassword();
const { secret, salt } = generateSecretAndSalt();
const PASSWORD = "Testing@123";
const SECRET_KEY = "u6wq45p2gdk0b1mk5tz3uv8dg7uo9mlv";
const SECRET_SALT = "2CGF8G";
const encryptPass = encryptPassword(SECRET_KEY, SECRET_SALT, PASSWORD);
const decryptPass = decryptPassword(SECRET_KEY, SECRET_SALT, encryptPass);
License
MIT