Re: Encryption functions - Mailing list pgsql-sql

From Thusitha Kodikara
Subject Re: Encryption functions
Date
Msg-id 20060519025542.9810.qmail@web30404.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Encryption functions  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-sql
Thanks for the guidance .<br /><br />-Thusitha<br /><br /><b><i>"D'Arcy J.M. Cain" <darcy@druid.net></i></b>
wrote:<blockquoteclass="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">
OnThu, 18 May 2006 06:44:55 -0600<br />Michael Fuhr  wrote:<br /><br />> On Thu, May 18, 2006 at 04:21:19AM -0700,
ThusithaKodikara wrote:<br />> > Are there any encryption functions that can be used in<br />> > SQL
insertsand selects directly? For example like<br />> > "select encryptin_function('test_to_be_encrypted'),
........"<br/>> <br />> See the contrib/pgcrypto module. It has functions like digest()<br />> for making
SHA1,MD5, and other digests; hmac() for making Hashed<br />> Message Authentication Codes; and
encrypt()/encrypt_iv()and<br />> decrypt()/decrypt_iv() for doing encryption and decryption. Since<br />> 8.1
pgcryptoalso has functions for doing OpenPGP symmetric and<br />> public-key encryption.<br /><br />If your
requirementsare simpler check out the genpass module. It is a<br />DES3 encrypted type. You can do things like "SELECT
*FROM table WHERE<br />passw = 'hello'" and it will find passwords that are entered as 'hello'<br />even though they
arestored encrypted. Example:<br /><br />darcy=# select 'hello'::chkpass;<br /> chkpass<br />----------------<br />
:v1L3NdWy0OHlQ<br/>(1 row)<br /><br />darcy=# select ':v1L3NdWy0OHlQ'::chkpass = 'hello';<br /> ?column?<br
/>----------<br/> t<br />(1 row)<br /><br />darcy=# select ':v1L3NdWy0OHlQ'::chkpass = 'nothello';<br /> ?column?<br
/>----------<br/> f<br />(1 row)<br /><br />Note that the leading colon says that the string is already encrypted.<br
/>Thisallows dump and restore to work correctly.<br /><br />-- <br />D'Arcy J.M. Cain  | Democracy is three wolves<br
/>http://www.druid.net/darcy/| and a sheep voting on<br />+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.<br
/><br/>---------------------------(end of broadcast)---------------------------<br />TIP 3: Have you checked our
extensiveFAQ?<br /><br /> http://www.postgresql.org/docs/faq<br /></blockquote><br /> 

pgsql-sql by date:

Previous
From: Thusitha Kodikara
Date:
Subject: Re: Encryption functions
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: Constraint question