Re: Field or record level encryption / decryption

From: Joshua Tolley <eggyknap(at)gmail(dot)com>
To: Hengky Lie <hengkyliwandouw(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Field or record level encryption / decryption
Date: 2009-08-14 22:28:20
Message-ID: 20090814222820.GC3940@eddie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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
> knowledge.
>
> Other question is where can i get pgcrypto modules ?

You haven't told us how you installed PostgreSQL, but you probably did it with
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
> and text, what encryption i can use ? As far as i know, there is no way
> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Yeb Havinga 2009-08-17 12:49:09 Multiple simultaneous queries on single connection
Previous Message Hengky Lie 2009-08-14 16:07:54 Re: Field or record level encryption / decryption