Skip to content

Instantly share code, notes, and snippets.

@randombit
Created November 27, 2018 15:51
Show Gist options
  • Save randombit/0f2e8c994d7ac4418743197035d9d2a3 to your computer and use it in GitHub Desktop.
Save randombit/0f2e8c994d7ac4418743197035d9d2a3 to your computer and use it in GitHub Desktop.
Generate secrets for wordpress
#!/usr/bin/python
import os
import binascii
keys = [
'AUTH_KEY',
'SECURE_AUTH_KEY',
'LOGGED_IN_KEY',
'NONCE_KEY',
'AUTH_SALT',
'SECURE_AUTH_SALT',
'LOGGED_IN_SALT',
'NONCE_SALT'
]
for k in keys:
print("define('%s', '%s');" % (k, binascii.b2a_base64(os.urandom(36)).decode('ascii').strip()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment