npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

random-password-toolkit

v1.0.2

Published

A powerful and versatile tool for generating secure, customizable passwords with encryption, decryption, and password strength validation features, random number, api key generator, otp generator.

Readme

Random Password Toolkit

Random Password Toolkit is a robust package for generating and managing random passwords with advanced functionalities such as encryption, decryption, strength checking, and customizable options. This toolkit is perfect for developers looking for a secure and feature-rich solution to handle password-related tasks in their applications.


Features

  • Random Password Generation: Generate strong and secure passwords.
  • Generate Multiple Passwords: Create multiple passwords in bulk.
  • Pronounceable Passwords: Generate passwords that are easier to read and pronounce.
  • Custom Password Generation: Create passwords using a custom pool of characters.
  • Password Strength Checker: Evaluate the strength of passwords with actionable feedback.
  • Password Encryption: Secure passwords with AES-256 encryption.
  • Password Decryption: Decrypt encrypted passwords safely.
  • Customizable Options: Fully customizable password generation settings.

Benefits

  • Security: Generate highly secure passwords to protect sensitive data.
  • Flexibility: Customize password generation to suit any application.
  • Ease of Use: Simple and intuitive API.
  • Compatibility: Works seamlessly with JavaScript and TypeScript projects.
  • Encryption & Decryption: Securely store and retrieve passwords.

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

Install the package using npm/yarn:

npm install random-password-toolkit

or

yarn add random-password-toolkit

Options

The following options can be used with the password generation functions:

| Option | Type | Description | Default | |-------------------------|----------|---------------------------------------------------------|---------| | length | Integer | Length of the password. | 10 | | numbers | Boolean | Include numbers in the password. | false | | symbols | Boolean | Include symbols in the password. | false | | lowercase | Boolean | Include lowercase letters. | true | | uppercase | Boolean | Include uppercase letters. | true | | excludeSimilarCharacters | Boolean | Exclude similar characters (e.g., 'i', 'l'). | false | | exclude | String | Characters to exclude from the password. | '' | | strict | Boolean | Enforce at least one character from each pool. | false |


Usage

Importing the Package

const {
  generate,
  generateMultiple,
  generatePronounceablePassword,
  generateWithCustomPool,
  checkPasswordStrength,
  encryptPassword,
  decryptPassword
} = require('random-password-toolkit');

1. Generate a Random Password

Generate a single random password with customizable options:

const passwords = generate(5);
console.log(passwords);
// Output: yKsmtgtDsJ
const password = generate({
  length: 12,
  numbers: true,
  symbols: true,
  uppercase: true,
  strict: true
});
console.log(password);
// Output: @D8cP#9Zr2&f

2. Generate Multiple Passwords

Generate multiple passwords at once:

const passwords = generateMultiple(5);
console.log(passwords);
// Output: ['g8sFwLp4Rx', 'pR2zT9qMf7', ...]
const password = generateMultiple({
  length: 12,
  numbers: true,
  symbols: true,
  uppercase: true,
  strict: true
});
console.log(password);
// Output: ['Fi:G+D1oTU','jec*<KSP:3','Z@ie>^]n7Q','6&J4O12}e?','K$9J|xDv|Y']

3. Generate Pronounceable Passwords

Create passwords that are easier to pronounce:

const pronounceablePassword = generatePronounceablePassword(8);
console.log(pronounceablePassword);
// Output: bolozuna

4. Generate Password with Custom Pool

Generate passwords using a specific set of characters:

const customPassword = generateWithCustomPool(8, 'abcd');
console.log(customPassword);
// Output: 2c1ea3fb

5. Check Password Strength

Evaluate the strength of a password:

const strength = checkPasswordStrength('MyP@ssword123');
console.log(strength);
// Output: Very Strong

6. Encrypt a Password**

Securely encrypt a password:

const encryptedData = encryptPassword('MySecurePassword');
console.log('Encrypted Password:', encryptedData.encryptedPassword);
console.log('IV:', encryptedData.iv);
/* Output:
Encrypted Password: 7de8fc05ab01ed48605fa1983c830e98e13716f507b59bbf1203f7f1361ee497
IV: dc23c48d84eed6b07d89c479af6c5845*/

7. Decrypt a Password

Decrypt an encrypted password:

// Decrypt the password using the returned IV
const decryptedPassword = decryptPassword(encryptedData.encryptedPassword, encryptedData.iv);
console.log('Decrypted Password:', decryptedPassword);
// Output: MySecurePassword

8. Test generating zero secrets

Test generating zero secrets

try {
    console.log(generateMultiple(0));
  } catch (error) {
    console.error(error.message); // Expected: 'Amount must be greater than 0.'
  }


9. Random Number Generator

Generates a random number within a given range, and the length of the number is defined by the length parameter. Parameters: min: The minimum value of the generated number. max: The maximum value of the generated number. length: The length of the generated number (total digits).

const random6DigitNumber = generateRandomNumber(100000, 999999, 6);
console.log(random6DigitNumber);  
// Output: A 6-digit number, e.g., "539812"


10. Ranom OTP Generator

A string representing the OTP.

const otp = generateOTP(6); // Generates a 6-digit OTP
console.log(`Generated OTP: ${otp}`);
// Output - Generated OTP: 9770112074


11. Random API Key Generator

Generates a secure random API key with the specified number of bytes. The API key is returned as a hexadecimal string.

Parameters: length (optional): The length of the API key in bytes (default: 32 bytes).

const apiKey = generateApiKey(); // Generates a 64-character API key (32 bytes in hex)
console.log(`Generated API Key: ${apiKey}`);
// output: Generated API Key: 84e19acaa6f069e4fe9540a85fcdc146ecf8ed86b72eacfb67c75aeab4c68da7

Community and Ecosystem

By using Random Password Toolkit, you are joining a growing community of developers who are passionate about secure passwords and encryption. We encourage you to share your experiences, ideas, and feedback on GitHub Discussions or any community platform of your choice.

  • GitHub Discussions: Share use cases, report bugs, and suggest features.

We'd love to hear from you and see how you're using Random Password Toolkit in your projects!

Issues and Feedback

For issues, feedback, and feature requests, please open an issue on our GitHub Issues page. We actively monitor and respond to community feedback.


License

This project is licensed under the MIT License. See the LICENSE file for details.