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:

    That a famous library has been cursed by a woman is a matter of complete indifference to a famous library. Venerable and calm, with all its treasures safe locked within its breast, it sleeps complacently and will, so far as I am concerned, so sleep forever. Never will I wake these echoes, never will I ask for that hospitality again ...
    Virginia Woolf (1882–1941)

    Literature does not exist in a vacuum. Writers as such have a definite social function exactly proportional to their ability as writers. This is their main use.
    Ezra Pound (1885–1972)