X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3BB125284E for ; Thu, 11 Aug 2005 17:39:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85288-06 for ; Thu, 11 Aug 2005 20:39:23 +0000 (GMT) Received: from web50602.mail.yahoo.com (web50602.mail.yahoo.com [206.190.38.89]) by svr1.postgresql.org (Postfix) with SMTP id E1AEA52E65 for ; Thu, 11 Aug 2005 17:39:22 -0300 (ADT) Received: (qmail 84272 invoked by uid 60001); 11 Aug 2005 20:39:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=PCxLpxxD4UuBRlPo/kcyKS1HDD1brhXlTOviPrE07VUFjS144qP9sUlg7EyducoCkBRNP89Hy/WfeyntUlnq359K5UrFI/M+HivDnHK67gcdIlyAihCREnQyLX0uIngMlPNTplfPZjKzPiglIP9owsOOiBAaMt9HCQXV1cJDmrM= ; Message-ID: <20050811203922.84270.qmail@web50602.mail.yahoo.com> Received: from [68.209.250.7] by web50602.mail.yahoo.com via HTTP; Thu, 11 Aug 2005 13:39:22 PDT Date: Thu, 11 Aug 2005 13:39:22 -0700 (PDT) From: Jeff Lu Subject: Fwd: How to encrypt a column To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-10872138-1123792762=:82357" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.655 tagged_above=0 required=5 tests=[AWL=0.224, DNS_FROM_RFC_ABUSE=0.374, HTML_30_40=0.056, HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200508/57 X-Sequence-Number: 22285 --0-10872138-1123792762=:82357 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 --0-10872138-1123792762=:82357 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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 --0-10872138-1123792762=:82357--