pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Lu <jeff_k_lu@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Fwd: How to encrypt a column
Date: Thu, 11 Aug 2005 13:39:22 -0700 (PDT)
Message-ID: <20050811203922.84270.qmail@web50602.mail.yahoo.com> (raw)

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 

view thread (8+ messages)  latest in thread

Message-ID: <20050811203922.84270.qmail@web50602.mail.yahoo.com>
Permalink:  ../20050811203922.84270.qmail@web50602.mail.yahoo.com/
Also on:    postgresql.org/message-id/20050811203922.84270.qmail@web50602.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jeff_k_lu@yahoo.com
  Subject: Re: Fwd: How to encrypt a column
  In-Reply-To: <20050811203922.84270.qmail@web50602.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox