The crypt function returns a hashed string. This is a complicated topic that has potentially important security implications, so be careful. You can use DES, Blowfish, or MD5 algorithms. The output depends on the operating system. Crypt creates a weak hash without the salt. There is no decrypt function, since crypt() uses a one-way algorithm.

    
    $password = 'password';
    $salt = '$1$somethin$';
    $passwordCrypt = crypt($password, $salt);

    printf("%s\n",$passwordCrypt);
    // $1$somethin$7on2JM7JeqSXcukty0bPq.