Re: encryption
| From: | Chris Moyer | Date: | Mon, 26 Jun 2000 17:43:36 +0000 |
| Subject: | Re: encryption | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3147@lists.php.net to get a copy of this message | ||
On Mon, Jun 26, 2000 at 06:23:13PM +0100, Adam Charnock wrote:
> So how would you decrypt the string?
>
> Adam
>
You don't... You store the md5 hash of the password. Then when a password is submitted,
you create a md5 has of that and compare them. I think md5 is theoretically one-way
encryption.
> > > Is there a way to encrypt a string in PHP? Like a password column, and
> > later
> > > verify with the same encryption test?
> >
> >I always use store the md5() of the password, and then use md5 when a
> >password is
> >submitted to compare to the hash in the DB. There is also a crypt()
> >fucntion, but
> >I've never used it.
-- Chris Moyer -- cmoyer@chekinc.com --
PHP Developer -- Chek.com