Re: Drawbacks of using BYTEA for PK?

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Drawbacks of using BYTEA for PK?
Date: 2004-01-12 21:59:58
Message-ID: 400318DE.2000506@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark wrote:
> On the other hand it is possible to do this right. Include a secret of some
> kind in the MD5 hash, something that's not publically available. That secret
> is in essence the password to the scheme. Now it's not really "obscurity" any
> more than any password based scheme is "security through obscurity".
>
> However even that isn't ideal, since you have to be able to change the
> password periodically in case it's leaked. I believe there are techniques to
> solve this though I can' think of any off the top of my head.
>
> But if your only threat model is people attacking based on the publicly
> visible information then an MD5 of the combination of a sequence and a secret
> is a perfectly reasonable approach.

We're originally talking about using MD5 as a means to generate unique
ID right (and not to store password hash to be checked against later)?

Then this "secret key" is unnecessary. Just get some truly random bits
(if the number of bits is 128, then you can use it as it is. If the
number of bits is > 128, you can hash it using MD5 to get 128 bit. If
the number of bits is < 128, you're "screwed" anyway :-)

--
dave

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keith C. Perry 2004-01-12 22:13:08 Re: Drawbacks of using BYTEA for PK?
Previous Message Richard Huxton 2004-01-12 21:36:53 Re: Announce: Search PostgreSQL related resources