Look in the manual for the crypt function.
$passwd=crypt($passwd,$encryption_key);
I use this so I don't store any plain text passwords in my user database. I use substr($passwd,1,2) as my encryption key rather that using a universal key.
It seems to work pretty good except the fact that the passwords are still transmitted in plain text. Not a problem for my application because I am on an internal LAN.
Hopefully this will help a bit.