RevealTheme logo

WordPress 金鑰產生器

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

define('AUTH_KEY', 'NAJ!QaB-HY[BB<c3M*<ak.1>5L#%JGd-E$5@#vMX[u,M#YX+V?pz]oGVBjN%RQNv');
define('SECURE_AUTH_KEY', 'pJ!v9pN$s!VG9qT=0B[A=Qj&VZt>7GwXcTP+99F.CYR-q^sT(PCfX1#v=-8$KZP*');
define('LOGGED_IN_KEY', '4o*h#H@TX&EIx0=xG5xLXmmjk5zc)K?WM^>7l<DF9(Xh<JYCU0UIEzMc]^R8T535');
define('NONCE_KEY', '.{yBQ9#[gQ{*9&HK$$)M@yInqLDeLq4z_Fx>V}MN?XBi{50X>k)aWj*3qs>hPcbo');
define('AUTH_SALT', 'N,s9yoS1B01vQD>xmM)wYVh0rIYtdQ>!dd4OzH33q45g^GDCzSOq]Zb$dO(h}^O0');
define('SECURE_AUTH_SALT', 'czVj]pw@)1yAFF(V-rCL?i(sIH+xe6Hs3^LM><go+Ov!c-wJl&9E0nv5k^NaQW+[');
define('LOGGED_IN_SALT', ')N$OFSg0DbkI,pI7K$H3xmLsm{I+#c1>V9.$E*zNBW!+xOmds{*H(<(+}(OAVqSo');
define('NONCE_SALT', 'm^4OWGw>nw.<FlHV}8(xH.p_3xc@+3yl2*pX[%hBl5cq9T0^iRTC)XY7mhY2<m38');

如何使用本工具

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

相關工具