RevealTheme logo

WordPress 金鑰產生器

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

define('AUTH_KEY', 'QZ$%@B]Y2Gx!Gvs(^MVZdU}uqbf{je.(vm7GSSLu[Vm]UxWavKh723)83M5Ckm%+');
define('SECURE_AUTH_KEY', 'u,ijJhGA,JfsoW7mEjc)<afvv)UHBZ(g%zcYAFh*g9^+t%b*LpQ0&!me{E^*5Klb');
define('LOGGED_IN_KEY', 'u.5g7P[0XzZk7v+#D0G4F=.}bF)g!F1.+DqjDf[(TU0+frgu@)Fm=vaq4qv-a&VN');
define('NONCE_KEY', 'pkFgsMB-YvnnxeWV&uz,.{@))+#8zX(Ng5)w_HaF0Z)TVaEJLYba{Wie=z6>fWqR');
define('AUTH_SALT', 'H@O@gytr^2bd=lxg#AvIBs7VP3ZYaK-DaqOrov@CO!mOw[>A{fb_Th*eLqfT[mJ?');
define('SECURE_AUTH_SALT', 'ZlP&Go5S]CT{FXttBn5&jX%K2<(Sr!h+!hZTYj=Q4DHImdUHfo$d>Jn!Lz9r<a1$');
define('LOGGED_IN_SALT', '&kV?L5O&8Zo5YGo#s5<-i^ScQKT3w^QRRmBY(Qt7@,.4I$kINqp*tWY!g3R<=A2}');
define('NONCE_SALT', 'h{A]D&aNP)(Q}f<vX&m0VD6+JK{4wTuqsjajgG[a7PnISU<,[OsRA=vW<@5u^yk-');

如何使用本工具

  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 值得信賴,但在本機產生意味著這些機密材料在網路上的暴露為零。

相關工具