Possible problem with pgcrypto

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Possible problem with pgcrypto
Дата
Msg-id 54D390DE.20707@wi3ck.info
обсуждение исходный текст
Ответы Re: Possible problem with pgcrypto  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Possible problem with pgcrypto  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-hackers
Hi,

I have encountered a small instability in the behavior of pgcrypto's
pgp_sym_decrypt() function. Attached is a script that can reproduce the
problem. It may have to be run repeatedly because the symptom occurs
rather seldom.

What the script does is to encode a small string with pgp_sym_encrypt()
and then repeatedly try to decrypt it with different "wrong" passwords.
The expected error message for that is of course

     "Wrong key or corrupt data".

Every now and then, I get a different error message. Things I've seen are:

     "Not text data"
     "pgcrypto bug"

This seems to be triggered by a combination of the random data included
in the encrypted data as well as the wrong password, because for an
instance of encrypted data only certain passwords cause this symptom.

I wonder if this may actually be a bug in pgcrypto or if this is an
error inherent in the way, the encrypted data is encoded. I.e. that the
decryption algorithm cannot really figure out what is wrong and just
sometimes gets a little further in the attempt to decrypt.


Jan

--
Jan Wieck
Senior Software Engineer
http://slony.info

Вложения

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: GRANT USAGE on FOREIGN SERVER exposes passwords
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Possible problem with pgcrypto