RevealTheme logo

WordPress 金鑰產生器

為你的 wp-config.php 產生全新的驗證金鑰和 salt:使用 crypto.getRandomValues() 在你的瀏覽器中執行。

define('AUTH_KEY', '.F%jN4(.S,+?5QeVh[Uc0xN7ve1SNmGHX<+#zToVFG@bPqw9&rr6r[bP!0]rZpU+');
define('SECURE_AUTH_KEY', 'A1u%yFZzL@wI&-Fj0*yZ3On(abza=00x7jlr5ZTA?lSfamlR?)kPJjQZFd?<f5o}');
define('LOGGED_IN_KEY', 'P!S0q3^g%q=Si<x_50wo8r@$E#<>slURX}yP13r6P,[m13VCLSk%DB!#^,mqXVvg');
define('NONCE_KEY', 'Yd#IHv,lgyxhvv}rER^xLDOk^jKzXkY-=-)QTfxWIW<USb3n#_H9c+UE7QR9{_bW');
define('AUTH_SALT', 'uGDQi%d{LqMuK4KGr2!2mxvF)z@gYrf[B5XtVh&##FZF?Ud[xZpQ(WXR8s#-()t#');
define('SECURE_AUTH_SALT', '>rlUjmy=gUXN6_pxleG0=JwsmAwwE{zQ1Ys@aVKKYR)ktIZre^9>fw6Be].A6toL');
define('LOGGED_IN_SALT', '6[P4]d)}vNLoM8RSFI@By*SSLAfi3Kh)BU=mWIt}]Ux00(zZj%5l5eX=5N?LG.zK');
define('NONCE_SALT', '#%xq77i26HM83]6SJPItY[8kEe,H<QJa)AhZVQqc#hk34xZX#CAGfcjqo}}fK[nS');

如何使用本工具

  1. 1

    點擊「重新產生」以產生全新的鹽值。

  2. 2

    將全部內容複製到剪貼簿。

  3. 3

    貼上並覆寫wp-config.php中現有的AUTH_KEY程式碼區塊。

  4. 4

    所有使用者都將被登出(Cookie失效)——這是預期的行為。

什麼是 WordPress 金鑰產生器?

WordPress 在 wp-config.php 中使用八個常數來加密 cookie 並為密碼雜湊加 salt。每一個都必須是一段長的隨機字串。官方端點 api.wordpress.org/secret-key 可以提供這些金鑰,但本工具使用你瀏覽器的加密亂數產生器在本機產生它們,因此它們絕不會經過網路傳輸。

常見使用場景

  • Setting up a brand-new WordPress install and replacing the placeholder 'put your unique phrase here' lines in wp-config.php.

  • Rotating keys after a suspected compromise to force-log-out every session and invalidate stolen auth cookies.

  • Off-boarding an admin or contractor and wanting to kill any sessions they may still hold.

  • Periodic security hygiene on a production site, swapping in fresh salts every several months.

  • Generating salts on an air-gapped or restricted machine where you would rather not call an external endpoint.

  • Cloning a site to staging and giving the copy its own distinct keys so the two environments do not share cookie signatures.

常見問題

我應該在什麼時候輪換 salt?
在網站遭到任何入侵之後、刪除被入侵的管理員使用者時,或作為定期的安全實務(每 6 至 12 個月一次)。
為什麼要在本機產生?
儘管 api.wordpress.org 值得信賴,但在本機產生意味著這些機密材料在網路上的暴露為零。

相關工具