Guide

Generating Secure Passwords: Methods and Best Practices

WWablyo Editorial
10 min readUpdated
How to generate secure passwords online illustration with entropy meter and cryptographic keys

Every day, billions of automated credential stuffing attempts, dictionary scans, and brute-force cracking attacks target user accounts across the web. Despite decades of cybersecurity warnings, human psychology consistently defaults to predictable shortcuts: appending family birth years, replacing letters with visual homoglyphs like "@" or "$", or reusing a handful of memorized passwords across dozens of personal and financial services. When a single service suffers a data leak, reused passwords grant malicious actors immediate access to secondary inboxes, social profiles, and bank portals.

True password security cannot rely on human intuition or manual pattern making. To effectively withstand modern cracking rigs powered by high-density GPU clusters capable of calculating hundreds of billions of hashes per second, passwords must be synthesized using unbiased mathematical randomness and adequate bit entropy.

This guide covers the mathematical foundations of password security: how password entropy is calculated, how Cryptographically Secure Pseudo-Random Number Generators (CSPRNG) prevent predictability, how to select between random character strings and multi-word passphrases, and how to use Wablyo’s client-side Password Generator to produce resilient credentials without exposing a single byte to external servers.

The Anatomy of Modern Password Attacks

Before assessing what makes a password secure, it is essential to understand how modern adversaries attempt to crack authentication credentials. Gone are the days when attackers manually typed guesses into login screens one by one. Today, offensive tooling leverages distributed botnets, multi-GPU rigs, and massive precomputed databases.

1. Brute-Force and GPU Hash Cracking

When a website database is breached, attackers rarely obtain plain-text passwords directly; instead, they retrieve cryptographic hashes (such as SHA-256, MD5, or bcrypt). Attackers then run offline brute-force tools like Hashcat or John the Ripper on specialized clusters containing multiple graphics cards.

A modern GPU cluster can compute over 100 billion SHA-256 guesses per second. If a password is only 8 characters long, even a full alphanumeric set (62 possible characters) represents 62^8 ≈ 218 trillion combinations, which a high-end cracking array can exhaust in less than an hour.

2. Dictionary and Mask Attacks

Pure brute force tries every possible permutation, but dictionary and mask attacks are far more efficient. Attackers feed known leaked wordlists (such as RockYou2024 containing billions of breached credentials) into cracking algorithms.

Mask attacks apply systematic human habits onto dictionary bases: capitalizing the first letter, appending common symbols like "!" or "?", and appending a 2-digit or 4-digit year at the end (e.g., "Password2024!"). Human-invented passwords that feel complex are often decrypted within seconds because cracking tools have rules designed specifically to emulate human habits.

3. Credential Stuffing & Rainbow Tables

Credential stuffing occurs when automated bots test username and password pairs leaked from one breached website against thousands of other platforms, including banking, cloud providers, and email hosts.

Rainbow tables are massive precomputed lookup tables of hashes that allow attackers to reverse unsalted passwords instantly. Modern systems utilize cryptographic salts to neutralize rainbow tables, but salting does not protect against dictionary attacks if the underlying password lacks entropy.

What Is Password Entropy and How Is It Calculated?

In computer science and cryptography, entropy is the objective mathematical measurement of unpredictability and information density in a password, expressed in bits. The greater the entropy, the larger the search space an attacker must traverse, and the longer it takes to guess the password.

Entropy is determined by two factors: the length of the password (L) and the size of the character pool from which each character is drawn (N). The mathematical formula is derived from Claude Shannon’s information theory:

Character Pool Sizes and Bit Gains

Each additional character set included in a password expands the pool size (N), which increases the bits of entropy contributed by each character position:

Character PoolPool Size (N)Entropy per Character12-Char Entropy16-Char Entropy20-Char Entropy
Numbers only (0–9)103.32 bits39.8 bits53.1 bits66.4 bits
Lowercase letters only (a–z)264.70 bits56.4 bits75.2 bits94.0 bits
Lower + Upper letters (a–z, A–Z)525.70 bits68.4 bits91.2 bits114.0 bits
Alphanumeric (a–z, A–Z, 0–9)625.95 bits71.5 bits95.3 bits119.1 bits
Full ASCII Symbols (letters, numbers, !@#$%...)946.55 bits78.7 bits104.9 bits131.1 bits

Interpreting Entropy Levels

Cybersecurity standards categorize entropy into specific resilience tiers against modern brute-force capabilities:

  • Under 28 bits (Very Weak): Vulnerable to immediate online dictionary attacks and instant offline cracking.
  • 28 to 35 bits (Weak): Protects against casual manual guessing, but cracked in seconds by automated scripts.
  • 36 to 59 bits (Moderate): Adequate for low-risk temporary forums, but susceptible to GPU-accelerated dictionary attacks.
  • 60 to 79 bits (Strong): Takes centuries for conventional hardware to crack; suitable for non-critical logins.
  • 80 to 127 bits (Very Strong): Mathematically impractical to crack with all computing power currently existing on Earth; recommended for primary email and financial accounts.
  • 128+ bits (Cryptographic Grade): Equivalent to symmetric encryption keys (AES-128); completely invulnerable to brute force for millennia.

Shannon Entropy Formula

Entropy (in bits) = L × log₂(N), where L is the password length and N is the number of possible characters in the selected character pool.

How CSPRNG and Rejection Sampling Ensure Unbiased Randomness

Not all software random number generators are built for security. In JavaScript and web development, developers frequently reach for standard functions like Math.random(). However, Math.random() is mathematically deterministic: it uses pseudo-random algorithms designed for speed in simulations and animations, not cryptography.

If an attacker observes several values generated by Math.random(), they can deduce the internal state of the generator and predict all future outputs. For password generation, a Cryptographically Secure Pseudo-Random Number Generator (CSPRNG) is mandatory.

The Web Cryptography API: crypto.getRandomValues()

Wablyo relies strictly on the browser’s native crypto.getRandomValues() method. This API interfaces directly with the underlying operating system’s cryptographic entropy sources—such as thermal sensor variations, keyboard timing jitter, mouse movements, and CPU interrupt timings.

Because the seed values originate from physical hardware noise, the sequence of drawn bytes exhibits uniform statistical distribution and passes rigorous randomness tests (such as NIST SP 800-22 and Dieharder).

Eliminating Modulo Bias via Rejection Sampling

A common developer flaw when writing random generators is using the modulo operator to map random byte values (0 to 255) to a smaller character set (such as a pool of 62 alphanumeric characters). Because 256 is not evenly divisible by 62 (256 mod 62 = 8), the first 8 characters in the pool have a slightly higher probability of being selected than the remaining 54.

This phenomenon is known as modulo bias. While subtle, statistical bias reduces overall entropy and gives specialized cracking tools an exploitable advantage.

Wablyo eliminates modulo bias entirely by using rejection sampling on 32-bit unsigned integers (Uint32Array): any random value drawn at or above the largest whole multiple of the character pool length within 2^32 is discarded and immediately re-drawn, guaranteeing that every character in the chosen pool has an identical mathematical probability of selection.

Step-by-Step: How to Generate Strong Passwords with Wablyo

Generating an uncrackable, high-entropy password using the Wablyo Password Generator takes only a few seconds and happens entirely inside your browser sandbox.

  • 1. Select your target password length: Use the interactive slider to choose your desired length. We recommend a minimum of 16 characters for regular services and 20 to 24 characters for primary email addresses, master passwords, or financial logins.
  • 2. Configure character sets: Ensure uppercase letters, lowercase letters, numbers, and symbols are enabled to maximize character pool diversity—in Wablyo’s generator, all four sets combine into an 86-character pool (26 uppercase, 26 lowercase, 10 digits, and 24 standard symbols), yielding approximately 6.43 bits of entropy per character.
  • 3. Toggle ambiguous characters: If you need to manually type the password on a mobile device, game console, or smart TV, enable "Exclude Ambiguous Characters" to remove easily confused look-alike characters (0, O, 1, l, and I).
  • 4. Copy with one click: Click "Copy Password" to place the generated token directly into your operating system clipboard. Password generation executes locally in browser memory, so generated passwords are never sent over the network or written to server logs.

Local Browser Memory Handling

Wablyo never writes generated passwords to localStorage, cookies, session storage, or analytics events. As soon as you refresh or close your browser tab, generated passwords are cleared from browser memory.

Passphrases vs. Random Character Strings: The Right Choice

When securing accounts, you will encounter two primary paradigms: complex random character strings (e.g., "9k#M7$vQ2!xL@8wZ") and multi-word passphrases (e.g., "correct-horse-battery-staple"). Both can achieve exceptional entropy, but they serve different user workflows.

Multi-Word Passphrases (Diceware Principle)

A passphrase consists of 4 to 6 randomly selected words separated by spaces or hyphens. Because the human brain excels at associating word sequences rather than chaotic symbol mixtures, passphrases can be memorized without compromising security.

If words are chosen randomly from a standardized wordlist of 7,776 words (the classic Diceware list, where 6^5 = 7,776), each word contributes log₂(7776) ≈ 12.9 bits of entropy. A 5-word random passphrase delivers ~64.6 bits of entropy, while a 6-word passphrase reaches ~77.5 bits—far stronger than an 8-character symbol soup, while remaining easily readable.

Random Character Strings (Manager-Stored)

For accounts that you do not need to memorize—which should be 99% of your online logins—random alphanumeric character strings generated by a password generator are superior. A 20-character random string provides over 130 bits of entropy, rendering brute-force attacks mathematically impossible even for quantum computing horizons.

FeatureRandom Character StringMulti-Word Passphrase
Best Use CaseAccounts stored in password managersMaster passwords & full-disk encryption PINs
Typical Length16 to 32 characters4 to 7 words (20 to 35 characters)
MemorabilityExtremely difficult to memorizeHigh (associative memory)
Resistance to MaskingTotal (no structural language rules)High if words are drawn from a large dictionary
Mobile Typing EaseLow (requires symbol switching)High (standard keyboard words)

Modern Credential Hygiene and Multi-Factor Defense

Generating a strong password is only the first layer of digital security. To establish complete defense-in-depth across your digital life, follow these verified standards endorsed by modern cybersecurity bodies:

  • Use a dedicated password manager: Utilize audited, zero-knowledge password vaults (such as Bitwarden, 1Password, or KeePass) to generate and store unique credentials for every account. You only need to memorize one strong passphrase for your vault.
  • Never reuse passwords across multiple services: Reusing credentials creates a single point of failure. If one service leaks, all associated accounts become vulnerable to automated credential stuffing.
  • Enable Multi-Factor Authentication (MFA): Always configure hardware security keys (FIDO2 / WebAuthn like YubiKey) or time-based one-time password (TOTP) authenticator apps. Avoid SMS-based 2FA when possible due to SIM swapping vulnerabilities.
  • Eliminate periodic password expiration policies: The National Institute of Standards and Technology (NIST SP 800-63B) officially recommends against forcing users to change passwords every 60 or 90 days. Forced rotations lead users to make trivial alterations (e.g., Summer2024! to Fall2024!). Change a password only when there is evidence of compromise.
Free Wablyo Tool

Password Generator

Generate strong, unpredictable passwords directly in your browser using cryptographic randomness without server uploads or storage.

Frequently Asked Questions

According to modern guidelines from NIST and leading cybersecurity organizations, you should only change passwords when there is a known compromise, a security breach notification, or suspicion that unauthorized parties gained access. Routine, forced rotations (like every 90 days) encourage predictable patterns and weaker password choices.

Conclusion

Digital security has shifted away from manual, memory-based passwords toward automated cryptographic tools. Attempting to invent and remember dozens of passwords inevitably results in predictable patterns and catastrophic credential reuse.

By pairing a client-side generator powered by unbiased WebCrypto randomness with an encrypted password vault and hardware multi-factor authentication, you establish a resilient defense against modern GPU hash clusters, dictionary masks, and credential stuffing attacks.

W
Wablyo Editorial

The editorial signature of the Wablyo platform, publishing practical guides for our browser-based tools.

Explore other practical tutorials to streamline your everyday digital work.