Re: [GENERAL] SHA1 on postgres 8.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Florian Weimer <fweimer(at)bfk(dot)de>
Cc: David Fetter <david(at)fetter(dot)org>, Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] SHA1 on postgres 8.3
Date: 2008-01-21 15:33:13
Message-ID: 7083.1200929593@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Florian Weimer <fweimer(at)bfk(dot)de> writes:
> * David Fetter:
>> Is there any country with laws so benighted that they restrict secure
>> hashing algorithms? Right now, there's a contest between SHA1 and
>> MD5 as to which one gets broken first, and SHA1 appears to be in the
>> lead. SHAn for n>1 could preempt the awfulness of losing this race.

> MD5 is broken in the sense that you can create two or more meaningful
> documents with the same hash.

Note that this isn't actually very interesting for the purpose for
which the md5() function was put into core: namely, hashing passwords
before they are stored in pg_authid. pg_authid is already secured
against viewing by non-superusers, and a superuser can crack into
your database account anyway, nyet? So the only reason we bother
with hashing here is to keep a superuser from finding out your cleartext
password, which might possibly let him crack into non-database services
that you foolishly used the same password for. Therefore, it doesn't
really matter if he can find another password with the same hash ---
that's not guarding against anything interesting.

Of course, if you want to store other sorts of protected stuff in the
database, you might not want md5, but at that point you're a candidate
to use contrib/pgcrypto.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian Weimer 2008-01-21 15:38:28 Re: [GENERAL] SHA1 on postgres 8.3
Previous Message Malm Paul 2008-01-21 15:19:28 Newbee to databases (ODBC)

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Weimer 2008-01-21 15:38:28 Re: [GENERAL] SHA1 on postgres 8.3
Previous Message Andrew Dunstan 2008-01-21 15:05:04 Re: Anyone tried PG with Perl 5.10?