Matching pgp_sym_encrypt() and gpg2 output

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Matching pgp_sym_encrypt() and gpg2 output
Дата
Msg-id 20190827173316.GA29115@momjian.us
обсуждение исходный текст
Ответы Re: Matching pgp_sym_encrypt() and gpg2 output  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
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'

    8c0d0409030248b24f9d2bc91287f5d24701...

while pgp_sym_encrypt() outputs:

    SELECT pgp_sym_encrypt('my access password', 'abc', 'cipher-algo=aes256');
                                                                            
         pgp_sym_encrypt
    ----------------------------------------
     \xc30d0409030282dbcc61c149fd4b67d24...

I realize the \x is from the bytea output function, but the hex digits
don't match, and the gpg2 output is slightly longer than the
pgp_sym_encrypt() output.  What gpg2 options will allow it to match?
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 +



В списке pgsql-general по дате отправления:

Предыдущее
От: Jeremy Thomason
Дата:
Сообщение: Re: import job not working
Следующее
От: Jerry Sievers
Дата:
Сообщение: No warning/error trying to vacuum other session's temp table