pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luke Woollard <luke@taborvision.com>
To: Joe Conway <mail@joeconway.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Password Encryption to replicate MySQL PASSWORD function
Date: Wed, 22 Jan 2003 15:28:52 +1100
Message-ID: <NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com> (raw)
In-Reply-To: <3E2E1AA5.4060205@joeconway.com>

COOL - THANKS FOR THE INFORMATION.

LW





-----Original Message-----
From: pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org]On Behalf Of Joe Conway
Sent: Wednesday, 22 January 2003 3:14 PM
To: Luke Woollard
Cc: pgsql-php@postgresql.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





view thread (6+ messages)  latest in thread

Message-ID: <NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com>
Permalink:  ../NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com/
Also on:    postgresql.org/message-id/NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: luke@taborvision.com, mail@joeconway.com
  Subject: Re: Password Encryption to replicate MySQL PASSWORD function
  In-Reply-To: <NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com>
  References: <3E2E1AA5.4060205@joeconway.com> <NGBBIAJCILLOIJPKMOIFCECHCMAA.luke@taborvision.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox