Crypt (Unix) - Library Function crypt(3)

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:

    Madam, a circulating library in a town is as an evergreen tree of diabolical knowledge; it blossoms through the year. And depend on it ... that they who are so fond of handling the leaves, will long for the fruit at last.
    Richard Brinsley Sheridan (1751–1816)

    To look backward for a while is to refresh the eye, to restore it, and to render it the more fit for its prime function of looking forward.
    Margaret Fairless Barber (1869–1901)