I always use crypt function to create http auth password but i can't decrypt it but with mcrypt_cbc i can decrypt it, is there a way to create the password using mcrypt_cbc?
thanks.
crypt() is used for hashing in php, which is why it is not intended to be 'decrypted'. The mcrypt functions give access to native block ciphers, they are not used for hashing in the same general sense, so the short answer is no.
The mcrypt functions take a mode flag;
To encrypt;
$ciphertext = mcrypt_cbc(MCRYPT_SERPENT_256, $secret_key, $plaintext, MCRYPT_ENCRYPT);
And to decrypt;
$plaintext = mcrypt_cbc(MCRYPT_SERPENT_256, $secret_key, $ciphertext, MCRYPT_DECRYPT);
However, you should not be encrypting or decrypting passwords in pretty much any circumstances!