X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2A2553A620D for ; Fri, 28 Jan 2005 09:11:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29209-06 for ; Fri, 28 Jan 2005 09:11:51 +0000 (GMT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id A6FC53A6227 for ; Fri, 28 Jan 2005 09:11:51 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 4.42) id 1CuSAQ-000MuI-Fy; Fri, 28 Jan 2005 09:11:51 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id A018F1734E; Fri, 28 Jan 2005 09:11:49 +0000 (GMT) Message-ID: <41FA01D5.6050708@archonet.com> Date: Fri, 28 Jan 2005 09:11:49 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Deepthi Darshan Cc: pgsql-sql@postgresql.org Subject: Re: References: <1106901557.41f9fa35222fb@granwill.com> In-Reply-To: <1106901557.41f9fa35222fb@granwill.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.068 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/304 X-Sequence-Number: 20092 Deepthi Darshan wrote: > Hi, > > I have a database which has been set to encoding UTF-8. > > I have a table in this database in which i store the details of all the > registered users. I am using PL/PGSQL and using one function i am entering the > values into the database. There is one column for entering the passwords of all > registered users. I want to store these passwords in an encrypted manner in the > table. Can i encrypt the password in the stored procedure and will i not loose > any data by entering the passwords in an encrytped manner. There are a range of encryption functions available in contrib/pgcrypto in the source distribution. Some encryption is one-way (so you can't recover the original password, just confirm a provided password matches it). Other encryption is two-way, but you usually have a separate key to encrypt the passwords then. -- Richard Huxton Archonet Ltd