Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 01525475EF9 for ; Fri, 10 Jan 2003 16:10:30 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 2780B475D3F for ; Fri, 10 Jan 2003 16:10:28 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h0ALAJP09820; Fri, 10 Jan 2003 16:10:19 -0500 (EST) From: Bruce Momjian Message-Id: <200301102110.h0ALAJP09820@candle.pha.pa.us> Subject: Re: Encrypted Passwords In-Reply-To: <20030110144927.M51502@dynedge.com> To: Rob Abernethy IV Date: Fri, 10 Jan 2003 16:10:18 -0500 (EST) Cc: postgresql X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/89 X-Sequence-Number: 6931 Rob Abernethy IV wrote: > How does postgres calculate the MD5 version of a password to store in the > database during user creation? I am trying to set up a postgres JDBCRealm to > work with Tomcat. The problem is that the resulting digest from Java is > different then the digest stored in the database for the same word. > > clear-text: tomcat > java: 1b359d8753858b55befa0441067aaed3 > postgres: md5efcc1c51a80be13b59cdb96d758a0184 What did you use as salt? PostgreSQL users the user name as salt. When I run /contrib/pgcrypto's MD5 I get the same value as PostgreSQL. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073