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  <br...@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 +


Reply via email to