On Tue, Jul 04, 2006 at 02:15:09PM +1000, Rod.. Whitworth wrote:
| >Ahhh, .. that's what hash's are for; easily recreatable given duplicate
| >input strings, but creating the input string FROM the hash is just about
| >impossible [lacking near infinate resources].
| >
| >Storing hashes in a DB is just fine - that's how passwords are encrypted
| >in any case. Comparing the current to any others in the past 90 days
| >would work swinningly for a secure audit train.
| >
| >     Lee
| >
| >
|
| So, you are suggesting using something other than the hash stored  in
| OpenBSD's master.passwd then?

Why exactly would we need another hash ?

| If not try this:
| Add a user, nothing special.
| Record the hash from master.passwd
| Log in as the test user.
| Change "your" password.
| Change it back.
| Compare the hashes.
| Different eh?

How come these are different ? What happened ? It's still the same
password, right ? How can one string hash to two different outputs ?

It can not. From http://en.wikipedia.org/wiki/Hash_function : "A
fundamental property of all hash functions is that if two hashes
(according to the same function) are different, then the two inputs
are different in some way. This property is a consequence of hash
functions being deterministic."

| So you need to change to a less secure password hash method.

Why ?

How does the system know you've entered the correct password when you
log in ? It applies $magic_function to the text it receives ('the
password') and maybe some other data. Then it compares the output of
this $magic_function to whatever is stored in the password database.
If it matches, hey, you're authenticated and you may log in.

Now we repeat the above procedure using $magic_function on the "new"
password and compare the output with a list of old hashes. What is
different ? Why would this stop working ?

Think about it.

| Will that affect the security audit?
| Test with well known cracker tools and weep. I have (as root) fed a
| slice of master.passwd to John the Ripper with a few nologin users
| added using dictionary words of 7 or 8 chars as passwords and after 10
| days it had not cracked one of them. I bet it takes less time on lesser
| hashes to get some results.

Your password is not hashed as-is. A salt is added (for extra flavour)
before hashing. This salt it also stored in the database along with
the hash. Enter your password, the system takes the hash from the
database, computes the hash of the concatenation of said salt with
the password you entered. Then the system compares the hash with what
it found in the database.

Google 'password salt'

Cheers,

Paul 'WEiRD' de Weerd

--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/

[demime 1.01d removed an attachment of type application/pgp-signature]

Reply via email to