Thread: Field or record level encryption / decryption
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
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
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"
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
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