X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 83B089FA1B0 for ; Thu, 18 May 2006 23:43:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 45564-06 for ; Thu, 18 May 2006 23:43:49 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web30412.mail.mud.yahoo.com (web30412.mail.mud.yahoo.com [68.142.201.235]) by postgresql.org (Postfix) with SMTP id 723CB9FA326 for ; Thu, 18 May 2006 23:43:49 -0300 (ADT) Received: (qmail 40272 invoked by uid 60001); 19 May 2006 02:43:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=47JtOWsbtz4PwciefKwmp7tD+SaWneSpAxm6obWtpi5JtUNFnAO04KqlPhgq7XxMZz9emaXdApViBoRLe6forf3ETpRqsL5fLwrXqP0aFUKjyiiPFzJJmKZyXPBun8t1gMTAG/pxmRnMl5c5c8dmN3ecTM2SItguGC2He36gvSY= ; Message-ID: <20060519024347.40270.qmail@web30412.mail.mud.yahoo.com> Received: from [203.115.30.220] by web30412.mail.mud.yahoo.com via HTTP; Thu, 18 May 2006 19:43:47 PDT Date: Thu, 18 May 2006 19:43:47 -0700 (PDT) From: Thusitha Kodikara Subject: Re: Encryption functions To: Michael Fuhr Cc: pgsql-sql@postgresql.org In-Reply-To: <20060518124455.GA8583@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1879627708-1148006627=:38417" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/149 X-Sequence-Number: 25180 --0-1879627708-1148006627=:38417 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thanks Michael, I'll check that module. Michael Fuhr wrote: On Thu, May 18, 2006 at 04:21:19AM -0700, Thusitha Kodikara wrote: > Are there any encryption functions that can be used in > SQL inserts and selects directly? For example like > "select encryptin_function('test_to_be_encrypted'), ........" See the contrib/pgcrypto module. It has functions like digest() for making SHA1, MD5, and other digests; hmac() for making Hashed Message Authentication Codes; and encrypt()/encrypt_iv() and decrypt()/decrypt_iv() for doing encryption and decryption. Since 8.1 pgcrypto also has functions for doing OpenPGP symmetric and public-key encryption. -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings --0-1879627708-1148006627=:38417 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thanks Michael, I'll check that module.


Michael Fuhr <mike@fuhr.org> wrote:
On Thu, May 18, 2006 at 04:21:19AM -0700, Thusitha Kodikara wrote:
> Are there any encryption functions that can be used in
> SQL inserts and selects directly? For example like
> "select encryptin_function('test_to_be_encrypted'), ........"

See the contrib/pgcrypto module. It has functions like digest()
for making SHA1, MD5, and other digests; hmac() for making Hashed
Message Authentication Codes; and encrypt()/encrypt_iv() and
decrypt()/decrypt_iv() for doing encryption and decryption. Since
8.1 pgcrypto also has functions for doing OpenPGP symmetric and
public-key encryption.

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

--0-1879627708-1148006627=:38417--