Re: Encriptar datos

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: "Mario Alberto Soto Cordones" <mario_soto(at)venezolanadeavaluos(dot)com>
Cc: <alvherre(at)dcc(dot)uchile(dot)cl>, <postgres(at)enelserver(dot)com>, <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Encriptar datos
Date: 2004-05-14 22:58:51
Message-ID: m3ekpmaa50.fsf@conexa.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

"Mario Alberto Soto Cordones" <mario_soto(at)venezolanadeavaluos(dot)com> writes:

> create table ecriptar (
> field1 numeric(14,2)
> )
>
> insert into encriptar
> values ( encrypt(123456))
>
> esto no funciona

Pues parece que nunca leiste el README, en fin, intenta algo como

create table ecriptar (
field1 bytea
)

insert into encriptar
values ( encrypt('123456'::bytea, 'foo'::bytea, 'bf'::text) );

Donde '123456' es el dato a encriptar, 'foo' tu llave y 'bf' el
algoritmo.

Nota que los datos encriptados se guardan en un bytea (array de bytes)
y no en el mismo tipo que el dato desencriptado.

Revisa el README.pgcrypto, ahi vienen todos los detalles.

Saludos,
Manuel.

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2004-05-14 23:35:01 Re: ERROR: missing ".." at end of SQL expression
Previous Message Mario Alberto Soto Cordones 2004-05-14 22:45:44 Re: Encriptar datos