Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 53D029FB7CD for ; Thu, 1 Mar 2007 07:39:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 99323-10 for ; Thu, 1 Mar 2007 07:39:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by postgresql.org (Postfix) with ESMTP id 6CF729FB62C for ; Thu, 1 Mar 2007 07:39:45 -0400 (AST) Received: from ppp247-71.static.internode.on.net (HELO [192.168.8.200]) ([203.122.247.71]) by ipmail02.adl2.internode.on.net with ESMTP; 01 Mar 2007 22:09:43 +1030 X-IronPort-AV: i="4.14,234,1170595800"; d="scan'208"; a="91553915:sNHT26468792" Message-ID: <45E6BB7F.2070509@Sheeky.Biz> Date: Thu, 01 Mar 2007 22:09:43 +1030 From: Shane Ambler User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Andrej Ricnik-Bay CC: Eugenio Flores , PostgreSQL Subject: Re: How to store a password encripted in a user defined table References: <629179.74925.qm@web55615.mail.re4.yahoo.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.005 tagged_above=0 required=5 tests=AWL, BAYES_50, BIZ_TLD, SPF_HELO_PASS X-Spam-Level: ** X-Archive-Number: 200703/6 X-Sequence-Number: 27644 Andrej Ricnik-Bay wrote: > On 3/1/07, Eugenio Flores wrote: >> Hello, I wonder if somebody knows how to store passwords in a >> column that is part of a user defined table. > Assuming that your passwords are application specific use > a sha1 or md5 algorithm (depending on how sensitive your data is) > and store that in a varchar or char field. When the user authenticates > the password gets hashed in the app and compared against the > stored hash. > If you want the server to take care of it look at pgcrypto - you will find it in the contrib folder of the source distro. This doesn't give you an encrypted data type (but you could set that up if you wish) it will give you functions that you can use. Of course that would mean they get sent through the client connection as clear text unless you are using an SSL client connection. -- Shane Ambler pgSQL@Sheeky.Biz Get Sheeky @ http://Sheeky.Biz