Library Function crypt(3)
crypt(3) is the library function which is used to compute a password hash that can be used to store user account passwords while keeping them relatively secure (a passwd file). The output of the function is not simply the hash— it is a text string which also encodes the salt (usually the first two characters are the salt itself and the rest is the hashed result), and identifies the hash algorithm used (defaulting to the "traditional" one explained below). This output string is what is meant for putting in a password record which may be stored in a plain text file.
This same crypt(3) function is used both to generate a new hash for storage and also to hash a proffered password with a recorded salt for comparison.
If the salt begins with the string $digit$ then the Modular Crypt Format is used. The digit represents which algorithm is used in encryption.
The crypt library function is also included in the Perl, PHP, Pike, Python, and Ruby programming languages.
Read more about this topic: Crypt (Unix)
Famous quotes containing the words library and/or function:
“It is the interest one takes in books that makes a library. And if a library have interest it is; if not, it isnt.”
—Carolyn Wells (18621942)
“... the function of art is to do more than tell it like it isits to imagine what is possible.”
—bell hooks (b. c. 1955)