Trying to check a wordpress password hash using phpass
Turns out I was using a Github project that didnt match the initial criteria used to generate the hashes. I discovered: https://github.com/Wolf480pl/PHPass which worked perfectly
Java - How to encrypt passwords for wordpress?
As mentioned here WordPress uses the PasswordHash
class from the phpass for generating the password hashes. According to the links, the default implementation used involves the use of a salt, and 8 rounds of MD5 hashing. Exactly how and when the salt is applied, and what goes into the MD5 don't seem to be readily available. However, there seem to be a java port of phpass here.
Wordpress User Password Data as Plaintext / Export Wordpress User Password to Django
Use this library, https://github.com/jmoswalt/wp-to-django-users
Basically you add django the capability to re-hash the old wordpress password, so that your old wordpress user can now use their same & old password on the new django site
Within your settings.py file for your django project, add the following:
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
'hashers_passlib.phpass',
)
then re-hash the password, and you are done.
from django.contrib.auth.hashers import get_hasher
hasher = get_hasher('phpass')
user.password = hasher.from_orig(user.password)
Related Topics
MySQLi Query Returns Only One Row
PHP Output Showing Little Black Diamonds With a Question Mark
Fatal Error: Class 'PHPmailer' Not Found
Is There a Built-In Way to Get All of the Changed/Updated Fields in a Doctrine 2 Entity
Notice: Trying to Get Property of Non-Object Error
Resize Animated Gif File Without Destroying Animation
Multiple Image Upload PHP Form With One Input
Convert Number to Month Name in PHP
What's the Difference Between 'Isset()' and '!Empty()' in PHP
How to Iterate Over the Results in a MySQLi Result Set
PHP Pdo: Get the Columns Name of a Table
Listing All the Folders Subfolders and Files in a Directory Using PHP
Why Is Json_Encode Adding Backslashes
Get Data from Json File With PHP
Converting Words to Numbers in PHP