DAuth
DAuth copied to clipboard
crypt(3) support broken
-
crypt does not use Base64, hence providing a crypt hash to parseHash fails with a Base64 exception Crypt uses it's own keymap (see e.g. here).
-
crypt transposes the hash bytes before encoding them (see sha512-crypt.c, sha256-crypt.c, and md5-crypt.c).
-
parseHash does not handle
$round=10000$parameters as 2nd component
You might want to add the following test case
$6$rounds=10000$tGiXIng0KHBPBHhk$84T63BF34OMoG4TeoGV7ReJ/U/OAtfa9iFOXQ/Wsd4s3N2wBcdUCPllpkzgYbFfagBcIZxyjqcfvL.KjdiBFJ1
which encrypts the password mypass.
Also passlib might be a useful inspiration for a correct implementation.