Re: pgcrypto functions fail for asymmetric encryption/decryption - Mailing list pgsql-general

From Marko Kreen
Subject Re: pgcrypto functions fail for asymmetric encryption/decryption
Date
Msg-id e51f66da0712050208k9926c3cv6a5a56aae17e949d@mail.gmail.com
Whole thread Raw
In response to pgcrypto functions fail for asymmetric encryption/decryption  (Stefan Niantschur <sniantschur@web.de>)
List pgsql-general
On 11/29/07, Stefan Niantschur <sniantschur@web.de> wrote:
> SELECT
> pgp_pub_decrypt(dearmor(armor(pgp_pub_encrypt(armor(pgp_sym_encrypt('geheim'::text,'test'::text)),dearmor((SELECT
> ens_pubkey FROM ens_user WHERE ens_userid =
> 10112)::text)))),dearmor((SELECT ens_privkey FROM ens_user WHERE
> ens_userid = 10112)::text),'test'::text);
> -> returns 'ERROR: Corrupt data' => problem

Reason for this seems to be wrong password for the key.

And pgcrypto is not very helpful pointing out the problem.

I need to review that part of code to give better error messages.
This is pretty common mistake that can happen.

--
marko

pgsql-general by date:

Previous
From: Tomas
Date:
Subject: pg_dump: could not format inet value
Next
From: Peter Eisentraut
Date:
Subject: Re: initdb - encoding question