[PATCH v1] man/man3/crypt.3: These functions accept many algorithms, not only DES
Alejandro Colomar
alx+linux-man@kernel.org
Wed Nov 11 18:55:01 GMT 2026
Hi Serge,
> Date: 2026-11-11 09:05:40-0600
> From: "Serge E. Hallyn" <serge@hallyn.com>
>
[...]
> > - salt is a two‐character string chosen from the set
> > - [a-zA-Z0-9./]. This string is used to perturb the algo‐
> > - rithm in one of 4096 different ways.
> > -
> > - By taking the lowest 7 bits of each of the first eight
> > - characters of the key, a 56‐bit key is obtained. This
> > - 56‐bit key is used to encrypt repeatedly a constant string
> > - (usually a string consisting of all zeros). The returned
> > - value points to the hashed password, a series of 13 print‐
> > - able ASCII characters (the first two characters represent
> > - the salt itself). The return value points to static data
> > - whose content is overwritten by each call.
> > -
> > - Warning: the key space consists of 2**56 equal 7.2e16 pos‐
> > - sible values. Exhaustive searches of this key space are
> > - possible using massively parallel computers. Software,
> > - such as crack(1), is available which will search the por‐
> > - tion of this key space that is generally used by humans
> > - for passwords. Hence, password selection should, at mini‐
> > - mum, avoid common words and names. The use of a passwd(1)
> > - program that checks for crackable passwords during the se‐
> > - lection process is recommended.
> > -
> > - The DES algorithm itself has a few quirks which make the
> > - use of the crypt() interface a very poor choice for any‐
> > - thing other than password authentication. If you are
> > - planning on using the crypt() interface for a cryptography
> > - project, don’t do it: get a good book on encryption and
> > - one of the widely available DES libraries.
> > + salt is a string used for determining the hasing algorithm
>
> typo: hashing
Thanks! Fixed.
> > + (possibly including parameters). It is also used to per‐
> > + turb the algorithm.
BTW, I suspect the salt is not used for perturbing the algorithm
anymore. From musl's source code, at least for SHA-512, I _think_ it's
not reading past the third '$', and thus it's not reading any random-ish
bytes.
Should I drop the second sentence?
Have a lovely night!
Alex
> > +
> > + The returned value points to the hashed password. The re‐
> > + turn value points to static data whose content is over‐
> > + written by each call.
--
<https://www.alejandro-colomar.es>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20261111/d9dd771e/attachment.sig>
More information about the Libc-alpha
mailing list