Fwd: How to encrypt a column

From: Jeff Lu <jeff_k_lu(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Fwd: How to encrypt a column
Date: 2005-08-11 20:39:22
Message-ID: 20050811203922.84270.qmail@web50602.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

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" ?

Thank you


---------------------------------
Start your day with Yahoo! - make it your home page

Responses

Browse pgsql-sql by date

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