You can use function crypt(). Look
up section "XCV - String Functions"
of the php manual.
But beware that this function does
not produce the same encrypted strings
on different operating systems. So your
program/data will not be portable.
Have a look at function md5() as well,
in the same section of the manual.
This function is portable, as far as
I know.
Hope this helps.