Q:

is there any function called crypt in C?  Or i have to build that function myself? 

crypt (const char *key, const char *salt)
I saw it in code, but i could not find the implementation of this function.  Is it some of the conventions of C? 

A:

It's specified by POSIX but not by any version of the C standard.  Careful though:

The crypt() function is a string encoding function.  The algorithm is
  implementation-defined.