Re: MAY I HAVE YOUR ASSISTANCE
| От | Fernando Hevia |
|---|---|
| Тема | Re: MAY I HAVE YOUR ASSISTANCE |
| Дата | |
| Msg-id | 076f01c90c49$5e157420$8f01010a@iptel.com.ar обсуждение исходный текст |
| Ответ на | Re: MAY I HAVE YOUR ASSISTANCE ("Gary Chambers" <gwchamb@gmail.com>) |
| Ответы |
Re: MAY I HAVE YOUR ASSISTANCE
|
| Список | pgsql-sql |
> -----Mensaje original-----
> De: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org] En nombre de Gary Chambers
> Enviado el: Lunes, 01 de Septiembre de 2008 11:31
> Para: D'Arcy J.M. Cain
> CC: jameskitambara@yahoo.co.uk; pgsql-sql@postgresql.org
> Asunto: Re: [SQL] MAY I HAVE YOUR ASSISTANCE
>
> >> I have one problem with the user table. I want to hide the
> password for the users.
>
> Here's what I did, which requires using the contrib/pgcrypto
> extension:
>
> CREATE FUNCTION encryptpw() RETURNS TRIGGER AS $encryptpw$ BEGIN
> NEW.password = CRYPT(NEW.password, GEN_SALT('md5'));
> RETURN NEW;
> END;
> $encryptpw$
>
> CREATE TRIGGER trg_encryptpw BEFORE INSERT OR UPDATE ON
> assignees FOR EACH ROW EXECUTE PROCEDURE encryptpw();
>
> Comments, suggestions, criticisms?
>
> -- Gary Chambers
>
The weakness of this solution is that your password might be send in the
clear through the network as the encription ocurrs in the database. I
suggest the encryption be enforced at the application or secure the
connection with ssl.
В списке pgsql-sql по дате отправления: