X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6BCDAD1C50D for ; Thu, 29 Apr 2004 07:07:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 66666-08 for ; Thu, 29 Apr 2004 07:07:12 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 575BBD1E5E1 for ; Thu, 29 Apr 2004 07:07:09 -0300 (ADT) Received: (qmail 26656 invoked by uid 500); 29 Apr 2004 10:11:29 -0000 Date: Thu, 29 Apr 2004 05:11:29 -0500 From: Bruno Wolff III To: list-postgresql-php Subject: Re: MD5 in pg and php Message-ID: <20040429101129.GC26489@wolff.to> Mail-Followup-To: list-postgresql-php References: <20040429070716.GA6918@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040429070716.GA6918@localhost.localdomain> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/58 X-Sequence-Number: 2715 On Thu, Apr 29, 2004 at 09:07:16 +0200, Joolz wrote: > > I want to store passwords in a pg db, MD5 seems like a good way to > enhance security (no more plaintext passwords over the line etc.) I > had a look at MD5, in PHP 4.3.4 there is a function md5() which seems > to work nicely: This may not help as much as you think. If you are using an ssl connection, the passwords won't be sent in the clear. If you aren't using an ssl connection the hashes will be in clear. I don't believe the postgres uses a random challenge so that you won't really raise the bar much. Plus if snooping passwords is a threat, most likely snooping data will be as well (though not always) and forcing connections to use ssl may be your best bet. I believe as typically used this is vulnerable to man in the middle attacks, but these are going to be significantly harder to do than simple snooping.