Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0C2DE634A76 for ; Fri, 14 Aug 2009 19:28:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50836-06 for ; Fri, 14 Aug 2009 22:28:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f180.google.com (mail-pz0-f180.google.com [209.85.222.180]) by mail.postgresql.org (Postfix) with ESMTP id 3287D6350D7 for ; Fri, 14 Aug 2009 19:28:41 -0300 (ADT) Received: by pzk10 with SMTP id 10so1270283pzk.28 for ; Fri, 14 Aug 2009 15:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=b5cxu7UUzobz4Z5K/x7L+8jufSre/Y9MwE5FL+I/m2I=; b=vnzzRN0UMIEGAC8P3cKCtg4QpU3PyD3EDFOmAJ3X4cpcB43g5sYmMkGcIy1adGKkbJ KKn0j+MZl/bL9GT7T1KyxwBVjd9d/Xx0/hNMnNyElXRmmpjqQZvWOc5XmZm700bHm2AY U2TBtOAM8l/whKxpuG5iKPDQNB+rgnpl3Los8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=heHhg0v6PzCbU9nLMGwPAS/FMIFApMFTmy9DwTEhNvdvMv5gL8HxBgGf1kGveXqgwX xk6fOeasJtXmYgunRmO9SdKK6zmG33tTima/tLBsmJH7Q63K6mLgVxyQ4x8DBpk6PPP6 2gpXbskzIis91JbsT7qQ3B/QMDBU42laBiw04= Received: by 10.114.88.12 with SMTP id l12mr2214041wab.19.1250288920526; Fri, 14 Aug 2009 15:28:40 -0700 (PDT) Received: from eddie (c-67-182-227-82.hsd1.ut.comcast.net [67.182.227.82]) by mx.google.com with ESMTPS id n33sm2954074wag.21.2009.08.14.15.28.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 Aug 2009 15:28:39 -0700 (PDT) Date: Fri, 14 Aug 2009 16:28:20 -0600 From: Joshua Tolley To: Hengky Lie Cc: pgsql-sql@postgresql.org Subject: Re: Field or record level encryption / decryption Message-ID: <20090814222820.GC3940@eddie> References: <697B993A-8A8A-4271-AE98-B7BB4D192608@gmail.com> <8763cqqv4c.fsf@dba2.int.libertyrms.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f+W+jCU1fRNres8c" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/83 X-Sequence-Number: 32992 --f+W+jCU1fRNres8c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 15, 2009 at 12:07:54AM +0800, Hengky Lie wrote: > Thanks to all who response my question. > > I have checked the doc, but it seems too advance for my postgresql =20 > knowledge. > > Other question is where can i get pgcrypto modules ? You haven't told us how you installed PostgreSQL, but you probably did it w= ith some operating system package. In that case, there's most likely a postgresql-contrib package (or some other similarly named package) you can install that will include pgcrypto. Within that package there should be some SQL file full of "CREATE FUNCTION" statements, which you need to run in each database where you'd like to use pgcrypto. > For simple record encryption that contains date field, varchar, integer= =20 > and text, what encryption i can use ? As far as i know, there is no way= =20 > to return MD5 result back to its original value. Is this true or not ? That's a bit beyond the scope of this mailing lists. Different methods and algorithms have different attributes, benfits, and drawbacks. I'd recommend studying the subject if you're trying to protect anything seriously. As to MD5, you're correct that the idea is you can't recreate the original value without an awful lot of computing time. But again, study the field before trying to do something serious. It's complex, and easy to get wrong. - Josh / eggyknap --f+W+jCU1fRNres8c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqF5QQACgkQRiRfCGf1UMP5XwCffGY5COBWu6ZNZ+qPMZYzfe86 jNgAn0nXeeCfYVSwyi0biMIUI0BZzP5k =6FQ1 -----END PGP SIGNATURE----- --f+W+jCU1fRNres8c--