Re: Encrypted column

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Ranieri Mazili <ranieri(dot)oliveira(at)terra(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: Encrypted column
Date: 2007-06-05 07:51:59
Message-ID: 4665161F.9090009@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Ranieri Mazili schrieb:
> Hello,
>
> I need to store users and passwords on a table and I want to store it
> encrypted, but I don't found documentation about it, how can I create a
> table with columns "user" and "password" with column "password"
> encrypted and how can I check if "user" and "password" are correct using
> a sql query ?

Passwords are usually not encrypted but hashed instead. A common hash
function is available in postgres w/o any additional extension:

md5()

The rule is, if two hashes compare equal, then the original data must
be equal (yes, there are chances for collisions, but practically very
low. See also sha1 and friends in the pgcrypto contrib module)

Regards
Tino

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-06-05 07:55:19 Re: $libdir
Previous Message Gregory Stark 2007-06-05 06:35:06 Re: There can be only one! How to avoid the "highlander-problem".

Browse pgsql-sql by date

  From Date Subject
Next Message Loredana Curugiu 2007-06-05 08:11:12 JOIN
Previous Message Guy Rouillier 2007-06-04 22:54:55 Re: Encrypted column