Re: Encrypted column

From: "Brian Mathis" <brian(dot)mathis(at)gmail(dot)com>
To: "Marko Kreen" <markokr(at)gmail(dot)com>
Cc: "Tino Wildenhain" <tino(at)wildenhain(dot)de>, "Ranieri Mazili" <ranieri(dot)oliveira(at)terra(dot)com(dot)br>, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: Encrypted column
Date: 2007-06-05 15:22:04
Message-ID: 183c528b0706050822t64a067aeg74d4190ae2a51807@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On 6/5/07, Marko Kreen <markokr(at)gmail(dot)com> wrote:
> On 6/5/07, Marko Kreen <markokr(at)gmail(dot)com> wrote:
> > both md5 and sha1 are actually easier to bruteforce than
> > the old DES-based crypt.
>
> If this statement seems weird - the problem is the speed.
> MD5 and SHA1 are just faster algorithms than des-crypt.
>
> And there's nothing wrong with fast general-purpose algorithms,
> as long their cryptographic properties hold. Starting from
> 20-30 bytes the bruteforce is really not an option.
>
> But if you have under 10 bytes (let be honest - you have
> 6 bytes...) the speed start to matter, because it is possible
> on random laptop to simply try all combinations.
>
> --
> marko
>

pgcrypto also supports md5, so I'm not sure what you're referring to
here. As I already mentioned, *salting* before you hash is a very
important step. I'm not sure if you saw that in my post. Without a
salt, it's trivial to generate a list of all combinations of md5'd
strings and their results, up to reasonable lengths. Then it would be
very simple to look up each hash and get the original text. With a
salt, you need to generate all possible md5s for all possible salts --
a much harder task.

In any case, pgcrypto seems to be a nice and full featured tool, so
one should use that instead of rolling their own.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2007-06-05 15:27:26 Re: Encrypted column
Previous Message Oliver Elphick 2007-06-05 15:14:54 Re: Foreign keys and indexes

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2007-06-05 15:27:26 Re: Encrypted column
Previous Message Marko Kreen 2007-06-05 15:09:43 Re: Encrypted column