Re: Urgent Help

From: "Daniel T(dot) Staal" <DStaal(at)usa(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Urgent Help
Date: 2006-05-31 13:40:22
Message-ID: 61121.63.172.115.138.1149082822.squirrel@MageHandbook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, May 26, 2006 7:47 am, Shreehari S said:

> Hello Sir,
>
> I am new to PostGreSQL. I have problem in encrypt/decrypt of password
> field, can you please help me out in how to solve this.
>
> I went through the pgcrypto.sql file under contrib folder but it was of
> no help to me.
>
> It will be of very helpfull if you send me some examples codes for insert
> statements and select statements for encrypt/decrypt.
>
> This is very urgent.

Just noticing that no one appears to have replied.

In general, Postgres does not have a 'password' record type. Passwords
are normally (in my experience) stored in text fields, after being
*hashed*, not encrypted.

The hashing is a detail of the application that is storing data in
Postgres, but it is common to use MD5 or SHA hashes.

The advantage, or disadvantage, of hashing over encrypting is that it is
not possible to get the password from the hash. To compare a password to
the stored version, you hash the password and compare the hashes.
(Hashing is also much faster than encrypting.)

Inserts and selects are therefore exactly the same as for any other record
type. Any difference is in what you do before and afterwords.

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2006-05-31 17:34:59 Re: Urgent Help
Previous Message alain.butzberger 2006-05-31 13:23:47 ODBC access: how to restrict the tables view and column detail?