密碼產生器

0
密碼長度
16chars
64
包含字元集
批次產生

免費安全密碼產生器,基於 Web Crypto CSPRNG 安全隨機源,生成隨機強密碼、易記口令和數字 PIN,支援強度檢測、批量匯出,瀏覽器本機生成。

相關推薦

什麼是安全密碼產生器?

密碼產生器使用 CSPRNG(密碼學安全隨機數生成器)從字符池中隨機選取字元,避免人類設密的可預測模式(名字+生日、鍵盤連按等)。

不能用 Math.random()——普通隨機數內部狀態可被反推。本工具使用 crypto.getRandomValues() 呼叫作業系統級 CSPRNG。

密碼強度的核心是熵值:log₂(字元池^長度)。16位隨機密碼熵值約 104 bit,暴力破解需約 2000 億年。

易記口令(Passphrase)由多個隨機單字組成,熵值足夠且更容易記憶,即 Diceware/XKCD 方法。

所有密碼在瀏覽器本機生成,資料不上傳伺服器。

適用場景

  • Generate strong random passwords for new accounts, check entropy and crack time
  • Batch-generate temporary credentials for teams or test environments
  • Generate memorable passphrases for Wi-Fi or device passwords
  • Set device PINs, initialize admin accounts, or reset passwords
  • Replace weak, human-created passwords with strong random ones

使用方法

  1. Select mode: Random, Passphrase, or PIN
  2. Set length, character options (16+ recommended), optionally exclude ambiguous chars
  3. Review strength: entropy, crack time estimate, weak password detection
  4. Copy or batch export to TXT for registration/reset/distribution

功能特點

  • CSPRNG generation: uses browser Web Crypto (crypto.getRandomValues) for cryptographically secure randomness
  • Three modes: Random password, Memorable passphrase (word combination), Numeric PIN
  • Full strength meter: character pool size, entropy, weak password detection, sequential/repeated char risk, brute-force time estimate
  • Exclude ambiguous: optionally skip 0/O/1/l/I for manual entry scenarios
  • Batch generation: generate 5/10/20 passwords at once with TXT download
  • Local-only: all generation and analysis happens in browser, no data uploaded

隨機密碼 vs 易記口令 vs 數字 PIN:該選哪個?

三種密碼模式各有取捨。選錯模式要麼記不住、要麼容易被偷、要麼根本用不上場景。根據「誰記住、誰輸入、誰儲存」來選,能少走很多彎路。

模式選它的典型問題安全強度易用性典型使用者
隨機密碼「我從不手敲,只讓密碼管理員自動填」高(16位可達 ~104 bit)差(記不住,必須配合管理員)主力郵箱、銀行、社群帳號、API Key
易記口令「我要能口述、能手敲、還要夠安全」中高(5-6 詞 Diceware ≈ 64-77 bit)好(人類可讀、可發音)主密碼、Wi-Fi、需要跨裝置輸入的密碼
數字 PIN「只用 0-9,受裝置限制」低(6 位僅 ~20 bit,10 位也只 ~33 bit)好(數字鍵盤就能輸)裝置鎖屏、銀行卡 PIN、一次性驗證碼

最佳实践

生成後立即用密碼管理員儲存,不要長時間留在螢幕上

新產生的強密碼是「全明文」狀態,停留在剪貼簿、螢幕、瀏覽器歷史裡都是風險點。生成 → 立即填入目標網站 → 清理剪貼簿,三步之間不要插入其他工作。**絕對不要**把產生的密碼截圖儲存到相簿,更不要寫在紙條上再拍照發給別人。本工具的密碼只在當前頁面存在,重新整理或關閉頁面後即丟失,所以請先準備好儲存位置再點生成。

產生的密碼會上傳到伺服器嗎?

主密碼用「長易記口令」,其他帳號用 16-20 位隨機密碼

分層策略:主密碼(解鎖密碼管理員)必須人類能記且強度足夠 → 選 5-6 詞 Diceware 易記口令。其他 99% 的網站/服務用 16-20 位隨機密碼 + 密碼管理員自動填入。**千萬不要**給每個網站都用易記口令(記不住、容易弱化),也**千萬不要**把主密碼也用隨機密碼(你會把它寫下來,安全歸零)。這是密碼管理的核心分層思想。

密碼多長才算安全?隨機密碼和易記口令哪個更安全?

只在需要人工錄入時排除易混淆字元

排除 0/O/1/l/I 等易混淆字元會顯著降低字元池大小(同長度下熵值會減少 5-10 bit),**僅在需要人工錄入、電話口述、列印分發時**才建議開啟。如果密碼只在密碼管理員裡使用,保留所有可列印字元能獲得更高熵值。一個簡單的判斷方法:「這個密碼會不會有一天需要我用手指敲出來?」—— 會就排除,不會就別排除。

為什麼要排除易混淆字元(0/O/1/l/I)?

批次產生只用於測試/分發場景,不要給生產帳號用相同方式

批次產生 5/10/20 個密碼的工作流程,主要適用於:測試環境初始化、臨時帳號分發、邀請碼產生、API Key 一次性輸出。**不要**把批次產生結果中的某一個複用到自己的生產帳號上——批次產生的密碼通常按相同規則產生,特徵明顯(字元集、長度、產生器類型),一旦某個帳號洩露攻擊者能猜到其他批次密碼的結構差異。生產帳號的密碼請單獨產生、單獨儲存。

本機產生不上傳

新密碼必須配合 2FA 才算真正安全

再強的密碼在釣魚、鍵盤記錄器、密碼庫洩露、電信業者內鬼面前都不堪一擊。**任何重要帳號(郵箱、銀行、社群、雲端硬碟)必須啟用雙因素認證(2FA)**,TOTP(Google Authenticator / Authy)> 硬體金鑰(YubiKey)> 簡訊。**避免使用簡訊 2FA**(SIM 卡交換攻擊可繞過)。強密碼 + 2FA + 密碼管理員三者缺一不可,2FA 是密碼洩露後的最後一道保險。

NIST SP 800-63B - 數位身分認證指南

已洩露密碼先用 HIBP 檢查再決定是否重設

懷疑某個密碼洩露時(看到新聞說某網站被脫褲、收到釣魚郵件等),不要立即改密——先用 Have I Been Pwned(HIBP)的 Pwned Passwords API 檢查這個密碼是否真的在洩露庫裡出現過。HIBP 提供 k-匿名 API,本工具未來可考慮整合;現在你可以手動去 haveibeenpwned.com/Passwords 用 SHA-1 前 5 位查詢。如果確認在庫裡才需要緊急改密,未洩露的不必為「心理安慰」強制改密(NIST 已明確不推薦定期改密)。

Have I Been Pwned - 密碼洩露檢查

常見問題

Why Web Crypto API instead of Math.random()?

Math.random() is a general PRNG not designed for security — its internal state can potentially be reverse-engineered. crypto.getRandomValues() uses the OS-level CSPRNG, producing unpredictable randomness suitable for passwords and keys.

Do passwords get uploaded to a server?

No. All passwords are generated locally in your browser. Strength analysis, entropy calculation, and crack time estimation all run client-side. DevTools Network tab confirms zero requests.

How long should a password be?

At least 12 characters with mixed case, digits, and symbols. A 16-character random password would take billions of years to brute-force at modern speeds. See the crack time table above.

Random password vs memorable passphrase?

Per-character, random passwords have higher entropy. But passphrases (4-6 truly random words) achieve 60+ bits of entropy and are much easier to remember. The key is truly random word selection, not self-invented phrases.

Why exclude ambiguous characters (0/O/1/l/I)?

These look similar in many fonts and cause input errors. If passwords are typed manually, read over phone, or printed, exclude them. If used only via password manager, keep all characters for higher entropy.

Is rotating passwords more secure?

Per NIST SP 800-63B, regular password rotation is NO longer recommended unless compromise is confirmed. Forced rotation leads users to choose weak passwords or write them down. Better: long random passwords + password manager + 2FA.

What is password entropy?

Entropy measures unpredictability in bits. Entropy = log₂(character_pool_size ^ length). A 16-char password from 94 printable ASCII chars has ~104 bits, meaning an attacker averages 2¹⁰³ guesses — about 200 billion years at 1 trillion guesses/sec.

術語表

CSPRNG
Cryptographically Secure Pseudo-Random Number Generator. Produces unpredictable output that passes rigorous randomness tests; even knowing many past outputs does not reveal future ones.
Password Entropy
Measures unpredictability in bits. Formula: log₂(N^L). 60+ bits = secure; 100+ bits = extremely strong.
Brute Force Attack
Trying all possible character combinations. Defended by using long random passwords that make combinations physically uncountable.
Dictionary Attack
Using lists of common passwords (123456, password, qwerty) to guess credentials. Much faster than brute force; random passwords are immune.
Credential Stuffing
Using leaked username/password pairs from one site to attempt login on others. Defended by unique passwords per site and checking Have I Been Pwned.
Passphrase
A password made of multiple random words. Easier to remember with high entropy when words are truly random (Diceware method).
Diceware
Arnold Reinhold's 1995 method using 5 dice rolls to pick words from a 7776-word list. 6 Diceware words ≈77 bits of entropy.
NIST SP 800-63B
NIST digital identity guidelines — the authoritative reference for password security. Since 2017, it no longer recommends regular rotation or mandatory special characters, emphasizing length, breached-password screening, and MFA.
2FA/MFA
Two-Factor / Multi-Factor Authentication requires a second factor beyond password (TOTP, hardware key). NIST recommends 2FA on all important accounts.
Breached Password Blacklist
Lists of publicly known compromised/common passwords (123456, password, admin, qwerty). NIST recommends checking against such lists at registration/password change.

Password Length vs Crack Time (upper+lower+digits+symbols)

LengthEntropy(bit)CombinationsCrack Time (1T guesses/sec)Rating
6 chars~37~139 billion< 1 second❌ Very weak
8 chars~52~2.2×10¹⁴~2.5 days❌ Weak
10 chars~65~3.7×10¹⁸~116 years⚠️ Fair
12 chars~78~6.1×10²²~1.9 million years✅ Strong
16 chars~104~6.3×10³⁰~200 billion years✅✅ Very strong
20 chars~131~6.7×10³⁸Trillions of universe ages✅✅✅ Unbreakable

Three Password Modes Comparison

ModeExampleTypical EntropyMemorabilityBest For
Random PasswordxK9#mP2$vL8@nQ4!~6.5bit/charPoorPassword-manager stored main passwords, DB passwords, API keys
Memorable PassphraseBrave-Cloud-Star42~10bit/wordGoodWi-Fi passwords, login passwords requiring manual entry
Numeric PIN4829173.3bit/digitGoodDevice lock screen, bank card PIN, one-time codes

Authoritative References