Search Postgresql Archives

Matching pgp_sym_encrypt() and gpg2 output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>        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 +





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux