Re: Password Encryption to replicate MySQL PASSWORD function

From: "Luke Woollard" <luke(at)taborvision(dot)com>
To: "Joe Conway" <mail(at)joeconway(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Password Encryption to replicate MySQL PASSWORD function
Date: 2003-01-22 04:28:52
Message-ID: NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

COOL - THANKS FOR THE INFORMATION.

LW

-----Original Message-----
From: pgsql-php-owner(at)postgresql(dot)org
[mailto:pgsql-php-owner(at)postgresql(dot)org]On Behalf Of Joe Conway
Sent: Wednesday, 22 January 2003 3:14 PM
To: Luke Woollard
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: [PHP] Password Encryption to replicate MySQL PASSWORD
function

Luke Woollard wrote:
> In mysql I have used the 'PASSWORD('someString')' function to encrypt each
> users password. When authenticating a user for system use, I use the same
> function to compare encrypted password.
>

From the MySQL manual:
"The PASSWORD() function is used by the authentication system in MySQL
Server,
you should *not* use it in your own applications. For that purpose, use
MD5()
or SHA1() instead." (emphasis added)

FWIW, the algorithm used in PASSWORD() must be pretty weak, as it appears to
only create an 8-byte (16 hex chars) hash. MD5() (16 bytes/32 hex chars) and
SHA1() (20 bytes/40 hex chars) are available in contrib/pgcrypto.
Alternatively you could use the PHP functions by the same names.

HTH,

Joe

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

Browse pgsql-php by date

  From Date Subject
Next Message ryanne cruz 2003-01-22 06:18:32 pg_result
Previous Message Luke Woollard 2003-01-22 04:27:54 Re: Password Encryption to replicate MySQL PASSWORD function