encrypting a query string - Mailing list pgsql-general

From Madison Kelly
Subject encrypting a query string
Date
Msg-id 469B7CC4.1000209@alteeve.com
Whole thread Raw
Responses Re: encrypting a query string  (Tino Wildenhain <tino@wildenhain.de>)
List pgsql-general
Hi all,

   Is it possible to take a string (ie: a user's password) and have
postgres encrypt the string before performing the query?

   At the moment, I am using postgresql + postfix for email. I need to
save the passwords in clear text in the DB and I don't feel safe doing
that. I'd like to save the passwords as an SHA1 hash. Then when postfix
checks the password it uses a query that converts the passed password
into an SHA1 hash then performs the comparison.

   So a pseudo code of what I'd like is:

SELECT foo FROM table WHERE passwd=sha1($password);

   I did a search on postgres's website and the only reference to SHA1 I
saw was in the connection to psql. I hope this doesn't mean it's not
possible. I'm much less familiar with postfix and am hoping to avoid
mucking around with it. :P

Thanks!!

Madison

pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: SMTP
Next
From: Michael Fuhr
Date:
Subject: Re: unconvertable characters