SWI-Prolog / packages-clib

Assorted external libraries: processes, sockets, MIME, CGI, etc.
8 stars 19 forks source link

Documentation of crypt/2 #16

Closed triska closed 7 years ago

triska commented 7 years ago

Please clarify what you wrote in eed65450f225030d00baae0d5b56872a1c32b435. Taking into account https://github.com/SWI-Prolog/packages-clib/commit/da4199eb04138e49ae46ad25331d0ca0138304ed, the following part seems no longer accurate:

Using crypt/2 is suitable if compatibility with OS passwords is required.

For comparison, my suggestion was: https://github.com/SWI-Prolog/packages-clib/pull/15/commits/1c861ff5bcac41bdd6d33fc8b0dfb82a4bdd96fc

Thank you!

JanWielemaker commented 7 years ago

I see little wrong with the way it is stated now. crypt/2 gives you OS compatible password hashing that may or may not be secure. Typically you select the algorithm using the salt that you provide, the details of which vary between OSes. The changes were needed because OpenBSD requires ways of specifying the algorithm through the salt that were not yet supported and it does no longer support the classical DES algorithm with its two-char salt.