Re: store data files encryptypted in database.

From: Michelle Konzack <linux4michelle(at)tamay-dogan(dot)net>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: store data files encryptypted in database.
Date: 2008-10-11 14:46:03
Message-ID: 20081011144603.GP3032@tamay-dogan.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hello X,

Am 2008-10-10 12:32:28, schrieb elmarkivp:
> hi, i'm trying to store data files encryptypted in postgres 8.1 database but i can`t make it works.
> this is what i'm doing.
>
> $link = pg_connect("host=$dbhost user=$dbuser password=$dbpwd dbname=$dbname") or die(pg_last_error($link));
> $fp = fopen($tmp_name, "rb");
> $file= fread($fp, filesize($tmp_name));
> fclose($fp);
> $file=pg_escape_bytea($file);
> $sql = "INSERT INTO SOME_TABLE (bytea_file) VALUES (pgp_sym_decrypt_bytea($file,somepass,cipher-algo=aes256))";
^^^^^^^^^^^^

> ERROR: column "content_of_bytea_file" does not exist ( "content_of_bytea_file" is $file)
^^^^^^^^^^^^^^^^^^^^^^^

There are two different columns.
I think, you should RECHECK your PHP script.

Greetings
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant

--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Tomas Vondra 2008-10-11 16:26:53 storing binary files / memory limit
Previous Message Sean 2008-10-10 20:03:44 Re: ERROR: relation "userroles" does not exist