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.