Generate passwords from the command line:
Linux/macOS (urandom)
OpenSSL
Entropy measures the randomness and unpredictability of a password. Higher entropy means harder to crack. It's calculated as: E = log2(C^L) where C = charset size and L = length.
| Entropy (bits) | Strength | Crack Time* | Recommended For |
|---|---|---|---|
| < 40 | Weak | Minutes | Don't use |
| 40-60 | Low | Days | Low-value accounts |
| 60-80 | Moderate | Years | Personal accounts |
| 80-100 | Strong | Millennia | Important accounts |
| 100-128 | Excellent | Heat death of universe | Critical systems |
Python (secrets module)
import secrets
import string
alphabet = string.ascii_letters + string.digits + "!@#$%"
password = ''.join(secrets.choice(alphabet) for _ in range(20))
print(password)Node.js (crypto module)
const crypto = require('crypto');
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%';
let password = '';
for (let i = 0; i < 20; i++) {
password += chars[crypto.randomInt(chars.length)];
}Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.