Re: MySQL encryption
| From: | Scott Barron | Date: | Wed, 18 Oct 2000 22:00:33 +0000 |
| Subject: | Re: MySQL encryption | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3758@lists.php.net to get a copy of this message | ||
Oh, ok.
Thanks for the help! What I meant by "hashing" out the passwords was
actually using md5('pass') in the database. For some reason, I thought
this would make my passwords # out. eg (password = bryan, password = #####)
I am just doing this for security between me (the site admin) and the
client who wants me to mess with the db.
Thanks for the help!
Bryan
>>bryan wrote:
>
> Hey everyone..
>
> I ask a ton of questions on here, and thanks for the help and patience from
> everyone.
>
> Anyhow, I am trying to Encrypt a password for my end users. I have done so
> in the MySQL db, by simply going ... PASSWD('mypass'), but it returns
> something such as "3afi4004idgv", and my original never works.
>
In order to compare a string with the output of PASSWORD you must also
run
it through PASSWORD, example: SELECT PASSWORD('foo') and compare that
value
with the encoded value thats in your database. I think that's what
you're trying
to do, if not please clarify. (Note: PASSWORD() does not use UNIX
crypt(3) but
ENCRYPT() will, if available.)
> Is there a way that i could "hash #" out the passwords instead of making a
> boggus number? Or should I not even care about the database, and simply
> ENCRYPT the passwords using PHP?
I'm not sure what you mean by this. PHP has a crypt() that is
equivalent to
UNIX crypt(3) (and MySQL's ENCRYPT()) if you wanted to go that route,
but normally
I just use PASSWORD.
-Scott
>
> Thanks!
> bryan
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
-------------------------------------------------------------------------------
"That's a deer shooting hat."
"Like hell it is. This is a people shooting hat. I shoot people in
this hat."