Re: hi i need to encrypt one field in a table

Поиск
Список
Период
Сортировка
От Mario Splivalo
Тема Re: hi i need to encrypt one field in a table
Дата
Msg-id 1149001795.18422.35.camel@localhost.localdomain
обсуждение исходный текст
Ответ на hi i need to encrypt one field in a table  ("Penchalaiah P." <penchalaiahp@infics.com>)
Список pgsql-sql
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."




В списке pgsql-sql по дате отправления:

Предыдущее
От: Juris
Дата:
Сообщение: Re: hi i need to encrypt one field in a table
Следующее
От: Miroslav Šulc
Дата:
Сообщение: DELETE ... USING ... - 8.0 and 8.1 compatibility problem