pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Ellis <Tim.Ellis@gamet.com>
To: David F. Skoll <dfs@roaringpenguin.com>
Cc: fstefan@cable.vol.at
Cc: pgsql-admin@postgresql.org
Subject: Re: OT: password encryption (salt theory)
Date: Wed, 21 Aug 2002 19:18:21 -0400
Message-ID: <20020821191821.1ba58982.Tim.Ellis@gamet.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0208212137490.22466-100000@shishi.roaringpenguin.com>
References: <20020821173638.4428eb90.Tim.Ellis@gamet.com>
	<Pine.LNX.4.44.0208212137490.22466-100000@shishi.roaringpenguin.com>

> But a straight md5sum leaves you open to a dictionary attack.

Of course. I argue everything does.

> You want
> to add some salt by doing something like this:
> 
> 	salt = random_4_char_string;
> 	encrypted_password = salt + md5sum(salt + cleartext_password);

I've always wondered about this. It just means for a dictionary attack,
instead of:

if (encpass == md5sum (dictionaryword))

you do

if (encpass == substr(encpass,4)+md5sum(substr(encpass,4)+dictionaryword))

Which obviously is just linearly slower than the normal dictionary attack.

What is the purpose of the salt in this case? I can only assume the
standard documented of using a salt is wrong, because I've never seen an
implementation that I could see increased the security over plain
hashing.

The only way I could see a salt increasing security is thusly:

salt = SomeSuperSlowAlgorithm (password)
encpass = md5sum (salt + password)

But you'd achieve as much by saying encpass=SuperSlowAlgo(password).

No matter how you obfuscate it, unless you can somehow turn it into a
O(x^n) problem, you're prone to dictionary attacks.

This is why most modern password-prompting algorithms do a "dictionary
attack" on your password and worn you. Witness:

	Changing password for user postgres.
	New UNIX password: (I enter "greatone")
	BAD PASSWORD: it is based on a dictionary word

So basically, your only hope is to either obfuscate the argument you pass
to md5sum (or whatever hash algorithm), somehow protect your md5sum list
of passwords(note that the shadow password file on Unix systems isn't
world readable), or ensure that all passwords entered by all users are not
attackable by a dictionary attack.

Can anyone explain to me why a salt is really a good idea or if, as I
suspect, it was an idea with good intentions that really doesn't help
anything?

-- 
Tim Ellis
Senior Database Architect
Gamet, Inc.



view thread (6+ messages)  latest in thread

Message-ID: <20020821191821.1ba58982.Tim.Ellis@gamet.com>
Permalink:  ../20020821191821.1ba58982.Tim.Ellis@gamet.com/
Also on:    postgresql.org/message-id/20020821191821.1ba58982.Tim.Ellis@gamet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Tim.Ellis@gamet.com, dfs@roaringpenguin.com, fstefan@cable.vol.at
  Subject: Re: OT: password encryption (salt theory)
  In-Reply-To: <20020821191821.1ba58982.Tim.Ellis@gamet.com>
  References: <20020821173638.4428eb90.Tim.Ellis@gamet.com> <Pine.LNX.4.44.0208212137490.22466-100000@shishi.roaringpenguin.com> <20020821191821.1ba58982.Tim.Ellis@gamet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox