pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: PostgreSQL-general <pgsql-general@postgresql.org>
Subject: Re: Matching pgp_sym_encrypt() and gpg2 output
Date: Tue, 27 Aug 2019 14:35:19 -0400
Message-ID: <20190827183519.GA29114@momjian.us> (raw)
In-Reply-To: <CAMkU=1xdDPi2cMoQuJ=Ln=1reF5orHRNQ7MgNZ68bTBQnfCxTg@mail.gmail.com>
References: <20190827173316.GA29115@momjian.us>
	<CAMkU=1xdDPi2cMoQuJ=Ln=1reF5orHRNQ7MgNZ68bTBQnfCxTg@mail.gmail.com>

On Tue, Aug 27, 2019 at 02:05:28PM -0400, Jeff Janes wrote:
> On Tue, Aug 27, 2019 at 1:33 PM Bruce Momjian <bruce@momjian.us> wrote:
> 
>     I am trying to generate output from the command-line program gpg2 that
>     matches the output of pgp_sym_encrypt().  gpg2 outputs:
> 
>             $ echo 'my access password' | tr -d '\n' | gpg2 --symmetric --batch
>             > --cipher-algo AES256 --passphrase 'abc' | xxd -p | tr -d '\n'
> 
> 
> I don't even get the same output on repeated execution of this same command, so
> I think you are pursuing a lost cause.

Ah, very good point.  I at least get the same first few bytes and same
length each time, so I never even looked at the trailing bytes, and you
are right that it isn't surprising they differ each time.

Anyway, I figured it out.  I was originally trying to use openssl to
match pgp_sym_encrypt(), and that wasn't working, and then when I
couldn't get the gpg2 bytes to match, I asked here.  Seems I got it
working with the attached SQL file.  Thanks.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

Attachments:

  key-pass-test.sql (application/x-sql, 510B) download

view thread (3+ messages)

Message-ID: <20190827183519.GA29114@momjian.us>
Permalink:  ../20190827183519.GA29114@momjian.us/
Also on:    postgresql.org/message-id/20190827183519.GA29114@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruce@momjian.us, jeff.janes@gmail.com
  Subject: Re: Matching pgp_sym_encrypt() and gpg2 output
  In-Reply-To: <20190827183519.GA29114@momjian.us>
  References: <20190827173316.GA29115@momjian.us> <CAMkU=1xdDPi2cMoQuJ=Ln=1reF5orHRNQ7MgNZ68bTBQnfCxTg@mail.gmail.com> <20190827183519.GA29114@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox