Re: Storing sensitive data

From: "Kevin Crenshaw" <kcrenshaw(at)viscient(dot)com>
To: "'Neil Saunders'" <n(dot)j(dot)saunders(at)gmail(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Storing sensitive data
Date: 2006-03-09 19:13:13
Message-ID: 20060309191317.3D4899DC97E@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Neil,

Thanks for your help! That's exactly what I was looking for.


Kevin

-----Original Message-----
From: Neil Saunders [mailto:n(dot)j(dot)saunders(at)gmail(dot)com]
Sent: Thursday, March 09, 2006 8:31 AM
To: Kevin Crenshaw
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Storing sensitive data

The usual way of doing this is by not storing the password, but
instead an MD5 representation of the password:

INSERT INTO users (username, password) VALUES ('kevin', MD5('mypassword'))

SELECT * FROM users WHERE username='kevin' AND password=MD5('mypassword');

This does mean that you won't know what your users passwords are, and
that a user can't be reminded of their password, only have it changed,
but these are usually un-important side effects.

Hope this helps,

Neil.

On 3/9/06, Kevin Crenshaw <kcrenshaw(at)viscient(dot)com> wrote:
>
>
>
> I have a table that stores usernames and passwords and I want to encrypt
the
> passwords before they are stored in the database. Will postgresql do this
> for me, or do I have to do the encryption on the client side? Could you
> please point me to some instructions on how to accomplish this.
>
>
>
> Thanks for your help,
>
>
>
> kevin
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-03-09 19:16:46 Re: Invalid Page Header
Previous Message Christopher A. Goodfellow 2006-03-09 18:48:40 Re: Invalid Page Header