pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Splivalo <mario.splivalo@mobart.hr>
To: pgsql-sql@postgresql.org
Cc: Penchalaiah P. <penchalaiahp@infics.com>
Subject: Re: hi i need to encrypt one field in a table
Date: Tue, 30 May 2006 17:09:54 +0200
Message-ID: <1149001795.18422.35.camel@localhost.localdomain> (raw)
In-Reply-To: <A70AE049E81A6A40879D5DC0AC8C38C90657F660@venus.infics.com>
References: <A70AE049E81A6A40879D5DC0AC8C38C90657F660@venus.infics.com>

On Tue, 2006-05-30 at 15:42 +0530, Penchalaiah P. wrote:
> Hello,
> I want to create a table with an encrypted field for a password entry, so
> that you can see only ********.
> And can I encrypt fields which datatype is an integer or a timestamp?

No can do. I mean, you can't do something like that. You can either give
(actually, revoke) that particular user/role permisions to read the
table with the passwords, or you could store hashed values to the
database. 

Later is prefered, I'd say. You could use md5() function to create
hashes, store those in the database, and when checking for the
credentials compare the hases. You'd compare user input flushed trough
md5() function with the hash you have in the database. That way you
don't know what user passwords are, and you could only set a new
password if user forgets his/hers password.

You don't need encrypted passwords. 

	Mario
-- 
Mario Splivalo
Mob-Art
mario.splivalo@mobart.hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."





view thread (3+ messages)

Message-ID: <1149001795.18422.35.camel@localhost.localdomain>
Permalink:  ../1149001795.18422.35.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1149001795.18422.35.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mario.splivalo@mobart.hr, penchalaiahp@infics.com
  Subject: Re: hi i need to encrypt one field in a table
  In-Reply-To: <1149001795.18422.35.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox