pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Field or record level encryption / decryption
5+ messages / 3 participants
[nested] [flat]

* Field or record level encryption / decryption
@ 2009-08-14 09:20  Hengky Lie <hengkyliwandouw@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Hengky Lie @ 2009-08-14 09:20 UTC (permalink / raw)
  To: pgsql-sql

Hi,

Anyone know what function i can use to encrypt /  decrypt field or  
record ?

When record saved, it saved in encrypt format. When i need to read  
data, i just call decrypt function.

I am using MS Access 2003 and Postgresql 8.3

Thanks a lot.

Regards,

Hengky



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field or record level encryption / decryption
@ 2009-08-14 13:24  Joshua Tolley <eggyknap@gmail.com>
  parent: Hengky Lie <hengkyliwandouw@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Joshua Tolley @ 2009-08-14 13:24 UTC (permalink / raw)
  To: Hengky Lie <hengkyliwandouw@gmail.com>; +Cc: pgsql-sql

On Fri, Aug 14, 2009 at 05:20:58PM +0800, Hengky Lie wrote:
> Hi,
>
> Anyone know what function i can use to encrypt /  decrypt field or  
> record ?
>
> When record saved, it saved in encrypt format. When i need to read data, 
> i just call decrypt function.

See the pgcrypto extension:
http://www.postgresql.org/docs/current/static/pgcrypto.html

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachments:

  signature.asc (application/pgp-signature, 196B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field or record level encryption / decryption
@ 2009-08-14 15:21  Christopher Browne <cbbrowne@ca.afilias.info>
  parent: Hengky Lie <hengkyliwandouw@gmail.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Christopher Browne @ 2009-08-14 15:21 UTC (permalink / raw)
  To: pgsql-sql

hengkyliwandouw@gmail.com (Hengky Lie) writes:
> Anyone know what function i can use to encrypt /  decrypt field or
> record ?
>
> When record saved, it saved in encrypt format. When i need to read
> data, i just call decrypt function.
>
> I am using MS Access 2003 and Postgresql 8.3

I'd suggest referring to the fine manual...
http://www.postgresql.org/docs/8.3/static/pgcrypto.html
-- 
output = reverse("ofni.sailifa.ac" "@" "enworbbc")
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field or record level encryption / decryption
@ 2009-08-14 16:07  Hengky Lie <hengkyliwandouw@gmail.com>
  parent: Christopher Browne <cbbrowne@ca.afilias.info>
  0 siblings, 1 reply; 5+ messages in thread

From: Hengky Lie @ 2009-08-14 16:07 UTC (permalink / raw)
  To: pgsql-sql

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 ?

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 ?

Thanks a lot


On Aug 14, 2009, at 11:21 PM, Christopher Browne wrote:

> hengkyliwandouw@gmail.com (Hengky Lie) writes:
>> Anyone know what function i can use to encrypt /  decrypt field or
>> record ?
>>
>> When record saved, it saved in encrypt format. When i need to read
>> data, i just call decrypt function.
>>
>> I am using MS Access 2003 and Postgresql 8.3
>
> I'd suggest referring to the fine manual...
> http://www.postgresql.org/docs/8.3/static/pgcrypto.html
> -- 
> output = reverse("ofni.sailifa.ac" "@" "enworbbc")
> Christopher Browne
> "Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
> phasers on the Heffalump, Piglet, meet me in transporter room three"
>
> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field or record level encryption / decryption
@ 2009-08-14 22:28  Joshua Tolley <eggyknap@gmail.com>
  parent: Hengky Lie <hengkyliwandouw@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Joshua Tolley @ 2009-08-14 22:28 UTC (permalink / raw)
  To: Hengky Lie <hengkyliwandouw@gmail.com>; +Cc: 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

Attachments:

  signature.asc (application/pgp-signature, 196B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2009-08-14 22:28 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-08-14 09:20 Field or record level encryption / decryption Hengky Lie <hengkyliwandouw@gmail.com>
2009-08-14 13:24 ` Joshua Tolley <eggyknap@gmail.com>
2009-08-14 15:21 ` Christopher Browne <cbbrowne@ca.afilias.info>
2009-08-14 16:07   ` Hengky Lie <hengkyliwandouw@gmail.com>
2009-08-14 22:28     ` Joshua Tolley <eggyknap@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox