Socket
Socket
Sign inDemoInstall

@eternaljs/password-generator

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @eternaljs/password-generator

A 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.


Version published
Maintainers
1
Created

Readme

Source

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:

// JavaScript
const {
  generateRandomPassword,
  generateSecretAndSalt,
  encryptPassword,
  decryptPassword,
} = require("@eternaljs/password-generator");


// TypeScript
import {
  generateRandomPassword,
  generateSecretAndSalt,
  encryptPassword,
  decryptPassword,
} from "@eternaljs/password-generator";


// Generate Random password
const genPassword = generateRandomPassword();
// rwB5TxBTaRSa


// Generate Random Secret and salt
const { secret, salt } = generateSecretAndSalt();
// e2d9252464600187c7d12fdcd048d4ad
// dc6e22


const PASSWORD = "Testing@123";
const SECRET_KEY = "u6wq45p2gdk0b1mk5tz3uv8dg7uo9mlv";
const SECRET_SALT = "2CGF8G";


// Encrypt a password by using Node Crypto CBC with secret key and salt
const encryptPass = encryptPassword(SECRET_KEY, SECRET_SALT, PASSWORD);
// Uxw2Gn+bteN3oQEkWU6JgQ==


// Decrypt a password by using Node Crypto CBC with secret key and salt
const decryptPass = decryptPassword(SECRET_KEY, SECRET_SALT, encryptPass);
// Testing@123

License

MIT

Keywords

FAQs

Last updated on 04 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc