Re: contrib/pgcrypto

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Marko Kreen <marko(at)l-t(dot)ee>
Cc: "Moran(dot)Michael" <Michael(dot)Moran(at)IGT(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/pgcrypto
Date: 2005-03-17 21:00:00
Message-ID: 20050317210000.GA2074@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 17, 2005 at 17:40:52 +0200,
Marko Kreen <marko(at)l-t(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-17 21:20:33 Lockfile restart failure is still there :-(
Previous Message Tom Lane 2005-03-17 20:15:58 Re: WIN1252 patch broke my database