Re: password encryption - Mailing list pgsql-admin

From David F. Skoll
Subject Re: password encryption
Date
Msg-id Pine.LNX.4.44.0208212137490.22466-100000@shishi.roaringpenguin.com
Whole thread Raw
In response to Re: password encryption  (Tim Ellis <Tim.Ellis@gamet.com>)
Responses Re: OT: password encryption (salt theory)
List pgsql-admin
On Wed, 21 Aug 2002, Tim Ellis wrote:

> I always run my passwords through md5sum(), which is an open source
> implementation, and thus seems to've been written in every language out
> there.

But a straight md5sum leaves you open to a dictionary attack.  You want
to add some salt by doing something like this:

    salt = random_4_char_string;
    encrypted_password = salt + md5sum(salt + cleartext_password);

To verify, just extract the salt from the encrypted password and redo the
calculation.

A dictionary attack is now much less feasible because the same cleartext
password can encrypt to millions of different ciphertext passwords.

--
David.


pgsql-admin by date:

Previous
From: Klaus Sonnenleiter
Date:
Subject: Re: password encryption
Next
From: Bruce Momjian
Date:
Subject: Re: DB Access Restrictions