2.0.1 • Published 3 months ago

@eternaljs/password-generator v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

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

2.0.1

3 months ago

2.0.0

3 months ago

1.1.1

6 months ago

1.1.0

7 months ago

1.0.9

7 months ago

1.0.8

8 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago