THE TOOLBOX / SECURITY & IDENTITY UTILITIES
Generate unbiased
CSPRNG credentials.
Create high-entropy passwords, multi-word Diceware passphrases, and prefixed API tokens using rejection-sampled Web Crypto CSPRNG with zero network calls.
THE DETAILS
Web Crypto CSPRNG, rejection sampling against modulo bias, and NIST SP 800-63B entropy math.
1. OS Kernel Entropy via Web Crypto
Every character, word, and byte is drawn from window.crypto.getRandomValues(), which interfaces directly with your operating system’s hardware-seeded CSPRNG. Unlike server-based generators, no credential ever crosses a network socket.
2. Modulo-Bias Rejection Sampling
Naive generators compute randomByte % pool.length, subtly skewing character frequencies whenever 256 is not divisible by the alphabet length. Our engine rejects values in the incomplete tail interval [2^32 - (2^32 % N), 2^32) and performs an unbiased Fisher-Yates shuffle.
3. Passphrases & Prefixed API Keys
Switch between high-density character passwords, memorable multi-word passphrases, and service-prefixed bearer tokens (sk_live_..., ghp_..., whsec_...) encoded in Base64URL, Hexadecimal, or Alphanumeric formats.
4. Offline Brute-Force Crack-Time Modeling
Real-time entropy telemetry evaluates $H = L \cdot \log_2(R)$ against three adversary models: rate-limited online logins ($10^4$/s), a dedicated GPU cracking rig ($10^10$/s), and a multi-GPU hashcat cluster ($10^12$/s). Need to hash a generated password for a database seed? Use the Bcrypt Hash Generator & Verifier, Web Crypto Playground, or UUID & SHA-256 Generator.
Credential Types & Entropy Comparison Matrix
| Credential Profile | Pool / Symbol Radix | Entropy Bits ($H$) | Recommended Use Case |
|---|
| 12-char Alphanumeric | 62 chars (5.95 bits/char) | ~71.4 bits | Standard user account with rate-limiting |
| 20-char Full ASCII Printable | 88+ chars (6.46 bits/char) | ~129.2 bits | Password manager vaults, root DB credentials |
| 5-word Diceware Passphrase | Wordlist (~12.9 bits/word) | ~64.6+ bits | Memorized master passwords & disk encryption |
| 32-byte Base64URL API Key | 256 raw CSPRNG bytes | 256.0 bits | HMAC signing secrets, Bearer API keys |
Common Credential & Secret Management Pitfalls
Look-Alike Character Lockouts
When typing credentials on mobile or server consoles, 0 (zero) vs. O (uppercase O) and 1 vs. l vs. I cause frequent lockouts. Keep Exclude look-alikes enabled for human-typed passwords.
Shell-Metacharacter Escaping in .env
Symbols like $, `, ", and # inside unquoted .env files or Docker Compose variables can trigger variable interpolation or comment truncation. Use Base64URL or Alphanumeric API Token mode for CI/CD secrets.
Bcrypt 72-Byte Password Truncation
The classic EksBlowfish Bcrypt algorithm only hashes the first 72 UTF-8 bytes of a password. If you use a passphrase longer than 72 bytes with Bcrypt, pre-hash with SHA-384 or use Argon2id.
Prefix Secret Scanning Compatibility
Adding a distinct prefix (such as app_live_) to API tokens allows Git pre-commit secret scanners to detect accidental commits without reducing the cryptographic entropy of the random payload.
Frequently Asked Questions
Why is window.crypto.getRandomValues() safer than Math.random() for passwords?
Math.random() uses a non-cryptographic pseudorandom number generator (typically xorshift128+) whose internal state can be reconstructed after observing a handful of outputs. window.crypto.getRandomValues() draws directly from the operating system kernel entropy pool (/dev/urandom on Linux/macOS, BCryptGenRandom on Windows), making outputs computationally unpredictable.
What is modulo bias and how does rejection sampling eliminate it?
When mapping a 32-bit random integer (2^32 = 4,294,967,296 possibilities) onto a character pool of size N via val % N, early indices receive one extra mapping whenever 2^32 is not evenly divisible by N. Our generator computes limit = 2^32 - (2^32 % N) and discards any sample >= limit before applying the modulo operator, guaranteeing a strictly uniform distribution.
How is password entropy (in bits) calculated?
Pool entropy measures the search space of a uniformly generated credential: H = L * log2(R), where L is the credential length and R is the size of the character pool (or wordlist size for Diceware passphrases). Every additional bit of entropy doubles the number of guesses required by a brute-force attacker.
Should I use a random character password or a multi-word Diceware passphrase?
For password managers and environment variables (.env, Kubernetes secrets), a 20–32 character random password or 256-bit API token provides maximum density. For master passwords that you must type from memory on physical keyboards, a 5- to 6-word passphrase with a separator provides 65–78+ bits of entropy with much lower typing friction.
Are generated passwords or API tokens ever logged or sent over the internet?
Never. Generation happens strictly inside your browser tab memory via the Web Crypto API with zero network requests, zero analytics telemetry, and zero persistence.