Re: contrib/pgcrypto - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: contrib/pgcrypto
Date
Msg-id 20050317210000.GA2074@wolff.to
Whole thread Raw
In response to Re: contrib/pgcrypto  (Marko Kreen <marko@l-t.ee>)
List pgsql-hackers
On Thu, Mar 17, 2005 at 17:40:52 +0200, Marko Kreen <marko@l-t.ee> wrote:
> On Wed, Mar 16, 2005 at 07:46:23AM -0800, Moran.Michael wrote:
> > How do you encrypt() & decrypt() data of types INT4 or DATE?
> > 
> > The PGCrypto methods encrypt() and decrypt() each take BYTEA as input:
> > 
> > i.e.,
> >     encrypt( data::bytea, key::bytea, type::text)
> >     decrypt( data::bytea, key::bytea, type::text)

Depending on what your purpose is, you may also want to use initialization
vectors. Otherwise attackers may be able to draw conclusions from rows
with matching encrypted date values. The int field could have a similar
problem.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIN1252 patch broke my database
Next
From: Tom Lane
Date:
Subject: Lockfile restart failure is still there :-(