Re: store files encrypted with pgcrypto

From: Chris <dmagick(at)gmail(dot)com>
To: elmarkivp <elmarkivo(at)hotmail(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: store files encrypted with pgcrypto
Date: 2008-10-21 21:56:58
Message-ID: 48FE502A.5090707@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

elmarkivp wrote:
> Hi, i'm trying to store files encrypted in postgres 8.3.4, using
> sym_encrypt_bytea function.
> this is quoted from the postgres8.3 documentation, thats was my guide,
> below is the php code i have used to make it, with no results and the
> respective errors.
>
> FROM http://www.postgresql.org/docs/8.3/static/pgcrypto.html
>
> F.20.3.1. pgp_sym_encrypt()
>
> pgp_sym_encrypt(data text, psw text [, options text ]) returns bytea
> pgp_sym_encrypt_bytea(data bytea, psw text [, options text ])
> returns bytea
>
>
> Encrypt data with a symmetric PGP key psw. The options parameter can
> contain option settings, as described below.
> F.20.3.2. pgp_sym_decrypt()
>
> pgp_sym_decrypt(msg bytea, psw text [, options text ]) returns text
> pgp_sym_decrypt_bytea(msg bytea, psw text [, options text ]) returns
> bytea
>

<snip>

> ERRORS:
> ERROR: No function matches the given name and argument types. You
> might need to add explicit type casts
> ERROR: function pgp_sym_encrypt_bytea(unknown, integer, unknown) does
> not exist

pgcrypto is a contrib module in pg 8.3 (ie not built in by default). Did
you install the module?

There are instructions on how to do that here:

http://www.postgresql.org/docs/8.3/static/contrib.html

--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Zied Kharrat 2008-11-06 19:45:21 apache+php+postgresql+WindowsXP
Previous Message elmarkivp 2008-10-21 16:03:28 store files encrypted with pgcrypto