Source code for cdh.core.hashers
from django.contrib.auth.hashers import (PBKDF2PasswordHasher,
UnsaltedMD5PasswordHasher)
[docs]class PBKDF2WrappedMD5PasswordHasher(PBKDF2PasswordHasher):
algorithm = 'pbkdf2_wrapped_md5'
[docs] def encode_md5_hash(self, md5_hash, salt, iterations=None):
return super().encode(md5_hash, salt, iterations)
[docs] def encode(self, password, salt, iterations=None):
md5_hash = UnsaltedMD5PasswordHasher().encode(password, '')
return self.encode_md5_hash(md5_hash, salt, iterations)