Re: pgcrypto functions fail for asymmetric encryption/decryption

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Stefan Niantschur" <sniantschur(at)web(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pgcrypto functions fail for asymmetric encryption/decryption
Date: 2007-12-05 10:08:32
Message-ID: e51f66da0712050208k9926c3cv6a5a56aae17e949d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/29/07, Stefan Niantschur <sniantschur(at)web(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2007-12-05 10:11:53 Re: initdb - encoding question
Previous Message Andrus 2007-12-05 09:32:59 Re: Avoid huge perfomance loss on string concatenation