Re: encryption
| From: | Tyler Longren | Date: | Thu, 06 Dec 2001 15:35:39 +0000 |
| Subject: | Re: encryption | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76895@lists.php.net to get a copy of this message | ||
I don't know if this was mentioned but you can do it all in MySQL with the
password() function.
Ex:
INSERT INTO users (username,password) VALUES ('tyler',PASSWORD('testpass'));
Also:
SELECT * FROM users WHERE username='$username' AND
password=PASSWORD('testpass');
Good luck,
Tyler Longren
----- Original Message -----
From: "Valter Santos" <valter.santos@fusionkit.com>
To: "Brian Clark" <brianj@fusionwerks.com>; "PHP is not a drug."
<php-general@lists.php.net>
Sent: Thursday, December 06, 2001 9:34 AM
Subject: Re: [PHP] encryption
> I agree... MD5 is the best way to store passwords...
> you only store the md5 hash of the actual password, then when the
> user logins you have to compare the stored hash with the md5 hash
> of password the user uses to login!
>
>
> cheers,
>
> Valter Santos
>
>
>
>
>
> ----- Original Message -----
> From: "Brian Clark" <brianj@fusionwerks.com>
> To: "PHP is not a drug." <php-general@lists.php.net>
> Sent: Thursday, December 06, 2001 2:48 PM
> Subject: Re: [PHP] encryption
>
>
> > * Justin French <justin@indent.com.au> [Dec 06. 2001 07:33]:
> >
> > > Can someone give me a brief over view of how to encrypt a password and
> > > store it in a MySQL DB, then be able to validate thier plain text
> > > password on login against the encrypted one on the DB?
> >
> > An alternative is to just store an Md5 of the password and not the
> > actual password.
> >
> > <http://www.php.net/md5>
> >
> > --
> > -Brian Clark
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>