The password generator creates cryptographically secure passwords using the Web Crypto API. It supports four complexity levels, a memorable password mode with word-based generation, and entropy-based strength estimation. When generating passwords during automated resets, the generator respects service-specific constraints from the service registry.
Password generation uses crypto.getRandomValues() with rejection sampling to eliminate modulo bias:
Copy
Ask AI
function secureRandomInt(max: number): number { const array = new Uint32Array(1) crypto.getRandomValues(array) const limit = Math.floor(0xFFFFFFFF / max) * max let value = array[0] while (value >= limit) { crypto.getRandomValues(array) value = array[0] } return value % max}
Why rejection sampling matters
A naive randomValue % max approach produces biased results when max does not evenly divide the range of possible values (0 to 2^32 - 1). Some remainders would appear more frequently than others. Rejection sampling discards values that fall in the biased range and re-rolls, ensuring each output in [0, max) is equally likely.
The memorable mode generates human-readable passwords by combining random words with a separator and a numeric suffix.Format: Word1<sep>Word2<sep>Word3<sep>NNN
Parameter
Value
Word count
2 to 6 (default: 3)
Word pool
40 common English words (nouns, adjectives, animals)
Separators
-, ., _, + (randomly selected)
Numeric suffix
3-digit number (100-999)
Capitalization
First letter of each word
Example outputs:
Tiger-Ocean-Brave-742
Cherry.Valley.Smart.319
Panda_Forest_Happy_856
Consecutive duplicate words are re-rolled to avoid patterns like Ocean-Ocean-River.
The estimateCrackTime() function estimates how long a password would take to brute-force, assuming 100 billion guesses per second (modern GPU cluster / ASIC throughput).
Overrides the default length for the selected complexity level
requireUppercase
Forces uppercase characters even for low complexity
requireLowercase
Forces lowercase characters
requireNumbers
Forces numeric characters
requireSymbols
Forces symbol characters
disallowedChars
Characters removed from the symbol set
specificSymbols
Replaces the default symbol set with service-specific symbols
Some services have restrictive password policies (e.g., maximum 20 characters, no symbols). The generator adjusts its output to comply with these constraints to avoid reset failures.