Re: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrongkey or corrupt data - Mailing list pgsql-bugs

From Jeff Janes
Subject Re: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrongkey or corrupt data
Date
Msg-id CAMkU=1wJQyYj14SXTwp0msnk=ShA0zizYeOB_biWf5F45JiWEQ@mail.gmail.com
Whole thread Raw
In response to BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrong key or corrupt data  (PG Bug reporting form <noreply@postgresql.org>)
Responses RE: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 : Wrongkey or corrupt data  (Frank Gagnepain <frank.gagnepain@intm.fr>)
Re: BUG #16476: pgp_sym_encrypt_bytea with compress-level=6 :Wrong key or corrupt data  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-bugs
 
select
pgp_sym_decrypt_bytea(pgp_sym_encrypt_bytea(bytea_import(DATA),'password','compress-algo=1,
cipher-algo=aes256, compress-level=6'),'password','compress-algo=1,
cipher-algo=aes256');


decryption reads the settings from the encrypted message header, there is no need to specify them again. 

I can reproduce this at any compression level if the data is random (not compressible) and exactly 16365 bytes long.  If the data is compressible, then you need a longer length of message to reproduce it and it depends on the random content and compression level.

I'm attaching the reproducer as a Perl script.  I have not investigated the C code of pgcrypto itself.

Cheers,

Jeff
Attachment

pgsql-bugs by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Potential G2-item cycles under serializable isolation
Next
From: Kyle Kingsbury
Date:
Subject: Re: Potential G2-item cycles under serializable isolation