Created
May 6, 2013 03:40
-
-
Save carlohamalainen/5523233 to your computer and use it in GitHub Desktop.
Create a Joomla password hash/salt entry using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import getpass | |
import hashlib | |
import random | |
import string | |
password = getpass.getpass('password (not echoed): ') | |
salt = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(32)) | |
password_hash = hashlib.md5(password + salt).hexdigest() | |
print "update CHANGEME_users set password='" + password_hash + ':' + salt + "' where id = ...;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's still working in 2021 with python 3.8.8
This is the only edit that I have made:
Thank you :)