Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F3926476B58 for ; Tue, 21 Jan 2003 23:23:47 -0500 (EST) Received: from taborvision.com (taborvision.com [128.121.222.15]) by postgresql.org (Postfix) with ESMTP id 1DC50476D90 for ; Tue, 21 Jan 2003 23:21:48 -0500 (EST) Received: from lwwindesktop (CPE-203-51-157-199.vic.bigpond.net.au [203.51.157.199]) by taborvision.com (8.11.6) id h0M4LjH26735; Wed, 22 Jan 2003 04:21:45 GMT From: "Luke Woollard" To: "Joe Conway" Cc: Subject: Re: Password Encryption to replicate MySQL PASSWORD function Date: Wed, 22 Jan 2003 15:28:52 +1100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-Reply-To: <3E2E1AA5.4060205@joeconway.com> Importance: Normal X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/33 X-Sequence-Number: 1778 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