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 6121B9FA2DB for ; Thu, 18 May 2006 09:45:16 -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 29105-01 for ; Thu, 18 May 2006 09:45:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id ECBEA9FA293 for ; Thu, 18 May 2006 09:45:02 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k4ICit5c006574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 May 2006 06:44:59 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k4ICitfS008677; Thu, 18 May 2006 06:44:55 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k4ICitDj008676; Thu, 18 May 2006 06:44:55 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 18 May 2006 06:44:55 -0600 From: Michael Fuhr To: Thusitha Kodikara Cc: pgsql-sql@postgresql.org Subject: Re: Encryption functions Message-ID: <20060518124455.GA8583@winnie.fuhr.org> References: <20060518112119.85801.qmail@web30406.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060518112119.85801.qmail@web30406.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/138 X-Sequence-Number: 25169 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