I am migrating a site from Drupal 7 to Django 1.4, including the current users. How can I work with the passwords that were hashed by Drupal?
According to this, Drupal 7
You should be able to implement this by creating your own subclass of BasePasswordHasher
, and adding it to your PASSWORD_HASHERS
setting.
Python's hashlib implements sha512.
The page David linked to in the question explains how the number of iterations (16385 for Drupal 7) is encoded in the hash, but it's not clear to me how to get the salt.
Edit: In the comment to @santiago's answer, David says the "the salt is the 5th character through the 12th in the stored Drupal string".