I have looked many places (Including the forum archive here and newsgroups) but I have yet to find the answer to my question. I am writing a script that will add a new user to an Apache .htpasswd file. The only thing I cannot figure out is what function to use in PHP that will encrypt a password like Apache does. Does anyone know the answer to this? I would be greatful if you helped me out. Thanks.