RevealTheme logo

WordPress密钥生成器

为你的wp-config.php生成全新的认证密钥和salt:使用crypto.getRandomValues()在你的浏览器中运行。

define('AUTH_KEY', 'c,uZWXk6Zz&WqvHaTqo35T#YHjs-OEqcCnM3+8R6$5g2*$KDLpTgw+9>>#,3ona,');
define('SECURE_AUTH_KEY', 'R>7ujCKh2d_iers[.4Wc-}d1vW&Z&X^&%QZcHP]ZiU?nYikII#<=CaZRjOki{FRn');
define('LOGGED_IN_KEY', 'g7APOO&LlMxUFZ*LpV#y4jOT}TSd0sSq?r9q(+,OMw01W$Sgrfp95gm8x0Q6UjdJ');
define('NONCE_KEY', 'L@{QycDgg{NYz}+p@Dxlm8h%p6_,pr{>LXIs&lO{pb1*b6}qOz!1$Hca&z=jU[OD');
define('AUTH_SALT', 'E52qygGU%%^>S0y3#(R2PTp$cA}oK=-=sda#G)LTW@^nY1R)Z(ZslmmA%vJGAZm6');
define('SECURE_AUTH_SALT', '*+k1PcvcO=,hZ=P%RSM8oMO0_hoW[Nv(l-FMES#5.?-U@V>v!uqjXq(SJ<k4^fB=');
define('LOGGED_IN_SALT', 'nSx[]Is[xi.Z*-$fkc0H%l7K0O)eCi-3Zq1UX^%+PG{niK9>ZC&$og[ae<wJJ%tC');
define('NONCE_SALT', 'Q@MGS&4v-HgdR@B01gkP)IuZxwHb)y{JSNFIx(}]^IaG8r7ukhB@]ZxOB{ii&f5$');

如何使用本工具

  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值得信赖,但在本地生成意味着这些机密材料在网络上的暴露为零。

相关工具