What Are the Keys and Salts in Your WordPress wp-config For?

Surely, while editing wp-config at some point, you’ve come across some lines with strange characters that you can’t understand just by reading them.

Something like this:

define( 'AUTH_KEY',         'v=V J$]5f^x=_<ttl>UCa>^VEj<9@JS[&j`*>hf5HGF@KR=D`JmN8_M^<aS#J$/1' );
define( 'SECURE_AUTH_KEY',  'xs)or79G/54xeYtB}mArwfirr8vb/t^O:@.5HxIpS!iO$Py^gPEkz^aEXDpDJ:D2' );
define( 'LOGGED_IN_KEY',    'cqdxO*%)F6ycRDs]qqJg781aG|0F}6#-UMp*I8gyWlP&9}vg<+mG>R0rdF+cdY/s' );
define( 'NONCE_KEY',        '4t[^r%KID2KEKs!+26iI{x>g=BxnZ4|1cE#0njGAKW71ad7fqr)leb9=lDeUN^x@' );
define( 'AUTH_SALT',        'IVen!b:=i]g-S7RP^CLlS 2FR49<:OD;0?X:It%+uQ]vxK;s_:JBwiz#/P*7*uwa' );
define( 'SECURE_AUTH_SALT', 'r&feIQqHH3osvLws&17=U= ]Co{<>3Bzsd1#TK>DX_j],rCiQ6YRQSY|sWF|y^YW' );
define( 'LOGGED_IN_SALT',   'Q;MM_veiG;,W~b kS)2,J(lxMMu [vXZQ_E.V QWzn <]es^sTQiPM =B_Xa;CP6' );
define( 'NONCE_SALT',       'PY oJo3zn>E-TC<Av^fae*KP4R=,&vKjThg+#%ftrg&*?z47jz-;~ph;#~5Ph>_r' );

Well, don’t worry, I’ll explain it to you. The first thing you need to know is that they are keys to improve your WordPress security, so you must not publish them or give them to anyone.

In this section we have 4 keys and 4 salts, and it’s important that you know what a salt is.

What Is a Salt?

A salt is a string of random data that is added to the value we are going to encrypt in order to improve security. It is frequently used when encrypting passwords. This way, even if someone uses brute force, without the salt, even if my password is 123456, they won’t crack it by entering 123456.

If my password is 123456, but my salt is asdasdasd, my encrypted password could be asdasdasd123456asdasdasd.

How to Generate New Keys and Salts

You can actually edit them by hand and that would work, since they are random keys, but WordPress has this link that generates them automatically so you only have to copy and paste.

AUTH_KEY

Used to encrypt the authentication cookie when a user logs in to the WordPress admin panel.

SECURE_AUTH_KEY

Used to encrypt the authentication cookie when accessing WordPress over an SSL connection.

LOGGED_IN_KEY

Used to encrypt the cookie that indicates a user is logged in.

NONCE_KEY

Used to generate and validate “nonces”, which are numbers used only once to protect URLs and forms from certain types of attacks.

AUTH_SALT

A “salt” combined with AUTH_KEY to improve encryption security.

SECURE_AUTH_SALT

A “salt” combined with SECURE_AUTH_KEY to improve encryption security on SSL connections.

LOGGED_IN_SALT

A “salt” combined with LOGGED_IN_KEY to improve the encryption security of the login cookie.

NONCE_SALT

A “salt” combined with NONCE_KEY to improve the security of “nonces”.