What I do is md5() encrypt the password and store it in the text file or
database.  Md5 is a one way algorithm, though, so you can never decrpyt the
password.  What you do, is when you want to authenticate a user, you md5
encrypt the text they typed in and compare that to the md5 hash in your file
or database or wherever.  If they match, you let them in.

Ethan Schroeder

----- Original Message -----
From: "Troy Moreland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 17, 2001 10:41 AM
Subject: [PHP] Encrypt Password for Session


> All,
>
> I am currently using sessions to store a user's ID, password and current
> login status.  All works fine.  The only issue is that the session file on
> the server is storing the password in plain text.  How do I encrypt that
> password and how to I decrypt it for comparing?
>
> Thanks in advance!!
>
> Troy Moreland
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to