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:

    A man’s library is a sort of harem.
    Ralph Waldo Emerson (1803–1882)

    Uses are always much broader than functions, and usually far less contentious. The word function carries overtones of purpose and propriety, of concern with why something was developed rather than with how it has actually been found useful. The function of automobiles is to transport people and objects, but they are used for a variety of other purposes—as homes, offices, bedrooms, henhouses, jetties, breakwaters, even offensive weapons.
    Frank Smith (b. 1928)