DAuth icon indicating copy to clipboard operation
DAuth copied to clipboard

crypt(3) support broken

Open MartinNowak opened this issue 8 years ago • 0 comments

  1. 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).

  2. crypt transposes the hash bytes before encoding them (see sha512-crypt.c, sha256-crypt.c, and md5-crypt.c).

  3. 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.

MartinNowak avatar Jun 28 '17 22:06 MartinNowak