Re: Fwd: How to encrypt a column

From: Hélder M(dot) Vieira <hmv(at)mail(dot)telepac(dot)pt>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fwd: How to encrypt a column
Date: 2005-08-11 21:26:13
Message-ID: 000d01c59ebb$4d611c50$580bfea9@hmv02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>I'm interested in encrypting an column in table. Are there any example
>using "C" to create the encrypted column, inserting and retreiving data
>to/from it?
>the table is:
>CREATE TABLE mytable (
> id SERIAL PRIMARY KEY,
> crypted_content BYTEA );
>I'm getting (null) in the field with the following sql statement:
>strcpy(data, "data to be encrypted");
>sprintf(query_buff, "insert into mytable values('%s', '%s')", key,
>encrypt(data, 'foo', 'bar'));
>PQexec(conn, query_string);

>Another question is can the encrypted column be of type "text" ?

I'd check a previous critical point ... The encrypt() function output.
What is the range of characters in encrypt() output ?
Control, null or false escape characters, if not properly escaped, could be
misleading either sprintf or the query processor in pg.

Helder M. Vieira

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Lu 2005-08-11 21:55:20 Re: Fwd: How to encrypt a column
Previous Message Owen Jacobson 2005-08-11 20:50:45 Re: Fwd: How to encrypt a column