webdevRefinery Forum: Hashing Myths - webdevRefinery Forum

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 20 September 2010 - 07:54 AM (#1)

Hashing Myths


Because our forum is being polluted with bad information.
Hashing seems to be a bit of a hot topic on wdR recently, and all these threads have a common theme: People are treating hashing myths as cold hard facts. And, by extension, teaching others and themselves some really really bad practices and flat-out lies. So, let's talk about those!

Myth #1: When you hash something, you get a unique result that no other file or string or password can have.
Wroonnnnggggg. Let's attack this one with simple logic. Let's say your hash is 32 characters long. Now let's say you hash every possible 33-character string there is. You will have strings with matching hashes, or "collisions". It's simple logic -- there are far more combinations of 33-character strings than there are of 32-character strings, because for every 32-character string that exists, you can tack on every possible character to the end and make a bunch of 33-character strings. So, just making up some example numbers, if there are 90,000 33-character strings and 20,000 32-character strings, some of those 33'ers MUST have the exactly the same 32-character hash. The goal of hashing algorithms is to make collisions as rare as possible, but it is impossible to write to a hashing algorithm that has no collisions.


Myth #2: MD5 is insecure.
Wroonnnnggggg. MD5 is a less sophisticated (and therefore much faster) hashing algorithm than, say, SHA-256, but it is not insecure. An insecure hash would mean that the hash could be reversed -- or rather, that you could take a hash, and, using that and having no other information, produce a string that has the same hash. You cannot do that with MD5. In fact, the closest anyone has gotten to this is changing an existing, large file in a way that doesn't change the hash it already has. No one in the history of humankind has been able to produce a "reverse" MD5. This myth comes from the fact that MD5 is a common target of password-cracking attacks, which leads to our next myth...


Myth #3: MD5 is less secure for password hashing than other algorithms like SHA.
Wroonnnnggggg. There are exactly three attacks that can be used to find out someone's password if you have the hash of that password:
  • Hash database lookup. You go to a super-large online database of short words and their hashes, plug in the hash, and see if a short word with that hash has ever been submitted before. A common prevention for this is to salt your passwords.
  • Brute force. You run through all the words of a dictionary, hashing each one, to see if the hash matches what you have on hand. If that doesn't work, you just start hashing every possible combination of 5, 6, 7, or 8-character words to find a match. This takes for effing ever and rarely produces a result, and can easily be prevented with a salt.
  • Rainbow tables. This is a method of hashing and re-hashing the data you have to find similarities in the hashes of other words, which can eventually lead to finding the password. Salts have minimal effect on these attacks.
Now I'm gonna drop some knowledge into that noggin of yours. Every single one of these attacks, INCLUDING RAINBOW TABLES, can be applied to any hashing algorithm in existence. Those of you using SHA-1 or SHA-256 because you think it's less susceptible to attack than MD5 have been lulled into a very false sense of security. Database lookups, brute forcing, and rainbow table-based attacks are just as easy with those other algorithms as they are with MD5, and in many cases are EASIER to attack. Which brings us to our next myth...


Myth #4: Sophisticated, super-long hashes like SHA-256 are harder to attack because they're longer.
Wroonnnnggggg. Let's face it: the biggest threat to hash cracking attacks is the rainbow tables method. It is by far the most efficient tradeoff between processing time and storage space, and often times can find a password in under a minute if you have enough chains. But rainbow tables are not magical. That's the impression most people have because it's easier to believe that than to learn how they work, but seriously, the rainbow table attack isn't hard to understand. I suggest reading up on it if you have a spare 15 minutes.

So if you know how rainbow tables work, you know that the biggest weakness they have is hash collisions -- which, you'll remember from above, means more than one string that produces the same hash. So password hashing security is a tradeoff: You want an algorithm that has reasonably few collisions so that no two passwords are likely to generate the same hash, but you also want one that produces enough collisions to potentially send a rainbow table into an endless loop that can't be cracked. SHA-256 is horrible for this, because it's too good a hashing algorithm. You're extremely unlikely to get any collisions at all when using SHA-256 for a password (even a salted one), so using that makes your passwords -- salted or not -- easier to crack. SHA-256 is awesome for hashing large files. Not so awesome for passwords.

At the same time, though, you don't want to use a measly 32 or 48-bit hash, because collisions are extremely likely with those. You want to find a happy medium, which is around 128 bits. What's a fast 128-bit hashing algorithm? MD5.


Myth #5: SHA-1 is still better to use than MD5 because MD5 is more likely to be cracked.
Wroonnnnggggg. Again, you're being lulled into a false sense of security. Not only is SHA-1 160 bits (so you'll still get collisions, but fewer than MD5), hash databases and rainbow tables are just as easy and well-developed for SHA-1 as they are for MD5. This myth is one that is spread far and wide among developers who have never taken the time to research the facts. The fact that SHA produces a longer hash has little-to-no impact on the ability to store them in a database or produce rainbow chains with them. All it takes is a tiny bit more storage space, and that's true for any hashing algorithm in the world, whether it's 8 bits or 8 thousand bits. The length only helps for reducing collisions, which, past around 128 bits, doesn't help at all when you're hashing passwords rather than large files.


Myth #6: Hashing with multiple algorithms is more secure!
Wroonnnnggggg. No. Just no. Come on, now you're just pulling stuff out of your ass. I've seen this before: sha1(md5("Password")). That is ridiculous. You're feeding 128 bits into 160 bits, which is an easy easy crack. You can't make hashes more-hashy. You might add one more step to the process for someone cracking it, but it's going to end up with the same result. Don't guess at what's more secure, know what's more secure.


Myth #7: Using a global salt AND a user salt is more secure than using just a user salt.
There was a thread recently in which folks supported the idea of using a global salt in addition to a user salt, and I dismissed it as pointless. I was met with some fierce opposition, claiming that it makes passwords more secure if a hacker should be able to steal a copy of your database but not your source code. This is true, however the amount of extra security this offers is minimal at best. Here's why:

Out of our list of attacks on hashes that I wrote out earlier, there is only one attack that's made more difficult to crack by using a global salt, and that's the brute force attack -- the one that's already almost impossible to use successfully to begin with. Adding a global salt only makes this more-impossible-than-nearly-impossible. So I'll admit there is SOME benefit, but with the most common and most successful attack being rainbow tables, folks would be crazy to try a brute force attack anyway. They'd just rainbow table it, and the global salt won't make your password any more secure than a properly long user salt would. And hey, let's face it: If someone's able to steal a copy of your database, chances are that they can nab a copy of your source without too much trouble too.

If you're looking to protect against the case where someone gets a copy of your database, a far, far, far more effective solution would be to use symmetric encryption on your hashes. Choose a fast, simple symmetric encryption algorithm (RC4, Blowfish... your call), generate a key and store it somewhere in a configuration file. Use that to encrypt all your salted password hashes in the database. Then, when you pull them from the database, just decrypt them with that key when you read them. Now you have a hash that can't even be attacked with a rainbow table if someone happens to gain unauthorized access to either your database or your account on the server, and this is still effective if you distribute your software to the public. MUCH more effective than using a global salt.


So what are the best practices for password hashing?
The only two, good options for password hashing are MD5 and SHA-1, and you should let the language you're programming in dictate which one you use. For PHP (and most languages), MD5 is faster than SHA-1, so it's the better option. The key to making it secure is using a salt of the appropriate length. The sweet spot for securely storing a password that isn't susceptible to dictionary or brute force attacks AND is relatively safe from rainbow table attacks is to feed twice the number of bits of a hash into a new hash. So, for example, using MD5, you'd want to hash two MD5s. You can generate a 128-bit salt for this (which, for a lot of users, can take up some significant storage space), or you can generate a salt that's just a handful of characters long and hash that. My favorite method is this:
$finalHash = md5(md5($salt) . md5($password))

The benefit of that is that you're feeding twice the data of an MD5 into a new hash (hitting the collision sweet spot), it's ultra ultra portable because you can do this in any language including raw SQL, three MD5s is still a relatively fast process, and, for web use, you can have javascript hash the password before it gets sent to your server and you can still generate the final hash with that.

Whether you want to put the symmetric encryption layer on top of that is entirely up to you :)


So please, for the love of all that is holy, stop teaching these myths to other people! The world's programmers thank you :D
9


User is offline Nico 

  • Group: Members
  • Posts: 260
  • Joined: 09-March 10
  • LocationSpain
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 20 September 2010 - 09:25 AM (#2)

Very.... very nice post, Kyek! :)

But I'd like to add one example in which global (hard coded) salts are more secure.

Let's assume we don't have access to the database, and our intention is not to look up passwords in rainbow tables. But instead, we have found an SQL exploit in a vBulletin forum, which allows us to modify an UPDATE query that writes to the "users" table.


We can do two things with that:

  • Grab the admin's password hash, and copy it to another field (which we can see without direct database access).

    • vBulletin uses unique salts for each user, and therefore it's very unlikely to find a match in a rainbow table. Brute forcing would probably be required to get the admin's password.

    • In that case, you're right, a global salt would be close to redundant.


  • Change the value in the "password" field.

    • The user passwords are hashed using unique (well, probably unique) salts. That's great, but it doesn't protect us from reusing the salt, to generate a new password.

    • We only have an SQL exploit, and still no access to the file system. But since there's no global hash, we can just run a query similar to:

      UPDATE `user`
      SET `password` = MD5(CONCAT(MD5('New password'),  `salt`))
      WHERE `userid` = 1
      


      ... and bang, now we're able to log in using the new password. A global salt could have prevented this because we're not able to access PHP variables from SQL.


Since SQL exploits are likely the most common (remember the pre-this-thread days?), I think it's a good practice to use a global salt. Now vBulletin relied on its own code, but didn't think that some of its add-ons (or "hacks", how they like to call them), might be insecure, and open the SQL injections.

So personally, I prefer to use both, one global and one unique salt.
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 20 September 2010 - 09:33 AM (#3)

View PostNico, on 20 September 2010 - 09:25 AM, said:

Very.... very nice post, Kyek! :)

But I'd like to add one example in which global (hard coded) salts are more secure.

That's a very good point :). Even so, though, I think a symmetric encryption is the better option. Not only does it unequivocally protect against an attack like the one you described, it also protects against a range of other attacks. AND it's something more feasible to store in a config file so it's changeable by the end user (should you be the type to distribute your code) whereas telling "global salt" to most folks implies a hardcoded value in the app.

So while a global salt would definitely help protect against that one specific kind of attack, I still think an actual encryption may be the more secure long-term method :)
0


User is offline kmyr 

  • Group: Members
  • Posts: 135
  • Joined: 21-June 10
  • LocationSouthampton, England
  • Expertise:HTML,CSS,PHP,Java,Javascript,SQL,Graphics

Posted 20 September 2010 - 09:49 AM (#4)

Informative and to the point, very good read :)
I do agree that the value-proposition of adding global salts is low and I believe all I've said personally is that in some types of attacks - mainly targeted ones, not practical for use on a huge set of users - it could potentially add value, if I was unclear about that and confused people I do apologize.


It's was also an interesting read for me because I realised I've been contradicting myself :P
I've been using ripemd160 as my hashing algorithm of choice because I don't care too much about speed and because it's relatively unknown and unused in comparison to md5 and sha1 which likely means there are fewer lists out there.

At the same time I've been trying to find ways to make it likelier to find a collision rather than the original password - something which would be much easier to do with a basic md5 hashing function like the one you describe.

I'm probably going to rethink how I hash passwords based on this post - mission accomplished Kyek.
http://kmyr.net
Web designer, Web developer
Student, BSc Computer Science, University of Southampton
0


User is offline Dissident 

  • Group: Members
  • Posts: 144
  • Joined: 08-March 10

Posted 20 September 2010 - 10:14 AM (#5)

A tip to all of you making your own hashing "algorithms" like this:

<?php

function awesomeHashingAlgorithm($data, $salt) {
return md5(md5(md5(sha1(md5(sha1(base64_encode(substr($salt, 1,1) . strrev(base64_decode($data))) . $salt . $data . $salt . $data . md5($data)))))) . "GLmd5(mdsha15())))))OBAL SALT, md5(md5(" . "I'M UNHAXABLE LOLOLOLOLOLOLOL");
}

?>


You're wasting your time, your code is useless, you're no more secure than before, your code is slow, no one cares about your arbitrary algorithm, etc.
2


User is offline Nico 

  • Group: Members
  • Posts: 260
  • Joined: 09-March 10
  • LocationSpain
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 20 September 2010 - 10:16 AM (#6)

View PostKyek, on 20 September 2010 - 09:33 AM, said:

So while a global salt would definitely help protect against that one specific kind of attack, I still think an actual encryption may be the more secure long-term method :)


Point taken! :) Thanks!
0


User is offline Dissident 

  • Group: Members
  • Posts: 144
  • Joined: 08-March 10

Posted 20 September 2010 - 10:25 AM (#7)

Here's an interesting fact some of you may not be familiar with. Due to the way MD5 and SHA1 (among others) work, the following is not good:

md5(md5($salt) . md5($password))


(I believe Kyek and I do this, I only realized people shouldn't be doing this a while ago.)

Apparently, a brute forcer would only have to calculate the salt once and then begin to use the MD5 algorithm and append the password data to generate tables. This would render the entire idea of a salt for protecting a single user's password slightly pointless. Salts should always go after the password, like this:

md5(md5($password) . md5($salt))


This is just a more secure habit, mind you. Don't worry, elves will not sneak up on you, burn your house down and leave you naked in the middle of the desert for doing it the former way.
1


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 20 September 2010 - 11:09 AM (#8)

View PostDissident, on 20 September 2010 - 10:25 AM, said:

Here's an interesting fact some of you may not be familiar with. Due to the way MD5 and SHA1 (among others) work, the following is not good:

md5(md5($salt) . md5($password))


(I believe Kyek and I do this, I only realized people shouldn't be doing this a while ago.)

Apparently, a brute forcer would only have to calculate the salt once and then begin to use the MD5 algorithm and append the password data to generate tables. This would render the entire idea of a salt for protecting a single user's password slightly pointless. Salts should always go after the password, like this:

md5(md5($password) . md5($salt))


This is just a more secure habit, mind you. Don't worry, elves will not sneak up on you, burn your house down and leave you naked in the middle of the desert for doing it the former way.

Interesting! That's the first I've heard that. I'm not sure I follow the logic, though -- because with the salt-last algorithm, wouldn't it be just as easy to calculate the salt once and then prepend the brute attack?
0


User is offline NoizeMe 

  • Group: Members
  • Posts: 591
  • Joined: 06-May 10
  • LocationGermany
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Node.js,SQL,MongoDB,CouchDB,Cassandra

Posted 20 September 2010 - 11:37 AM (#9)

View PostKyek, on 20 September 2010 - 11:09 AM, said:

Interesting! That's the first I've heard that. I'm not sure I follow the logic, though -- because with the salt-last algorithm, wouldn't it be just as easy to calculate the salt once and then prepend the brute attack?


I think he was talking about a global salt and not a unique user salt ;D.
If your salt would stay the same all the time you would need knew the first X character of every result.

Lets pretend this case:
$salt = "12345";
$password = "password";
$hash = md5(md5($salt) . md5($password));

Once we decoded $password once our code renders to:
$hash = md5(md5("12345") . md5($password));

We successfully eliminated the hash.
That does not happen to us if we append the hash, because we are not getting the same ending everytime ;).
This also makes it okay to store the user salt right next to the hashed password.

A small note to using symmetric encryption on the passwords being better then a hard-coded hash:
If you once introduced a global hash to your process you never, ever be able to change it, which is logic.
But you actually CAN change the password of a symmetric encryption at any time without rendering your data to a useless chunk :D.
Posted Image
0


User is offline magik 

  • magikly delicious
  • Group: Members
  • Posts: 1095
  • Joined: 08-March 10
  • Expertise:HTML,PHP,Javascript,SQL

Posted 20 September 2010 - 12:03 PM (#10)

View PostKyek, on 20 September 2010 - 11:09 AM, said:

Interesting! That's the first I've heard that. I'm not sure I follow the logic, though -- because with the salt-last algorithm, wouldn't it be just as easy to calculate the salt once and then prepend the brute attack?


not sure I understand that either. And wouldn't the outer md5 negate the brute force? Wouldn't the hacker need to know if the salt/md5(salt) is either prepended or appended to the user's pass/md5(pass) ?


Also, in regards to the global salt debate. I think I agree with Kyek, although yes, this does put another level of "security" on top, is it needed? and does it really prevent much? If the problem is SQL injection and being able to find the stored data in the users table, wouldn't a better solution be to attack that problem - the SQL injection hole? Another thing, if you can't patch SQL injection holes, or the way you code is innately prone to SQL injection attacks, then maybe a better idea would be to practice better SQL injection prevention techniques... Sure a global salt can be one of them, but in my mind it'd be better to re-structure your database. Don't call your users table "users", that's an easy guess. Maybe you should store your password hash and salts in another table with a hard to guess name? I guess this doesn't really help if you have so many SQL injection problems that you don't sanitize any user input, as you would probably expose this table in the end anyways....


Quote

A small note to using symmetric encryption on the passwords being better then a hard-coded hash:
If you once introduced a global hash to your process you never, ever be able to change it, which is logic.
But you actually CAN change the password of a symmetric encryption at any time without rendering your data to a useless chunk :D.


if you change the password of a symmetric encryption, wouldn't you need to go back an re-encrypt the data? I guess you still have the ability to do this if you use encryption, but with a hash, since you can't un-hash it, you'd have to get the original input again
.... magik's most awesomely rainbowed signature =þ


the wdR forums, on crack rocks, said:

Your signature may contain:
  • Any number images
  • Images of any size
  • Any number of URLs
  • Any number of lines

dangerous...
0


User is offline derTechniker 

  • BadBoy™
  • Group: Members
  • Posts: 1210
  • Joined: 06-July 10
  • LocationAustria
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 20 September 2010 - 01:03 PM (#11)

Thanks Kyek for this great post (again).

Still i have some questions:

Quote

Choose a fast, simple symmetric encryption algorithm (RC4, Blowfish... your call), generate a key and store it somewhere in a configuration file.


What do you mean with that? Could you please give me an example code?

Quote

They'd just rainbow table it, and the global salt won't make your password any more secure than a properly long user salt would.


Well what is a properly long salt? md5(time()) ?

Thanks
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 20 September 2010 - 01:12 PM (#12)

View PostderTechniker, on 20 September 2010 - 01:03 PM, said:

What do you mean with that? Could you please give me an example code?

It's all a little different depending on which encryption algorithm to use. Really, it's overkill unless your site is big and folks target attacks at it. If you're interested, though, read up about mcrypt.

Quote

Well what is a properly long salt? md5(time()) ?

Read a little further down ;-) I usually generate a 5-10 character string to store in the database, then hash that. It's not a set-in-stone rule, but it's generally good practice to hash enough characters that you can guarantee collisions on some level. md5'ing the string versions of two 120-bit hexadecimal numbers does a fairly decent job of that without being overly heavy, and is very easily portable to other languages including SQL itself.
1


User is offline dida 

  • Group: Members
  • Posts: 1976
  • Joined: 10-March 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,Node.js,SQL,Graphics,Flash,MongoDB,CouchDB,Cassandra

Posted 20 September 2010 - 01:24 PM (#13)

Once i've heard about a function called crypt() or something like that. Is that safe to use? Is it worse than md5?

Oh and great tutorial! I was looking for something like this ;)
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 20 September 2010 - 01:47 PM (#14)

View Postdida55, on 20 September 2010 - 01:24 PM, said:

Once i've heard about a function called crypt() or something like that. Is that safe to use? Is it worse than md5?

Crypt is just a gateway function to a bunch of different hashing algorithms, MD5 included. Check out the documentation-- it gives all the details: http://php.net/manua...ction.crypt.php
0


User is offline dida 

  • Group: Members
  • Posts: 1976
  • Joined: 10-March 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,Node.js,SQL,Graphics,Flash,MongoDB,CouchDB,Cassandra

Posted 20 September 2010 - 02:04 PM (#15)

Great, thank you. +rep (when i'll be on pc)
0


User is offline Dissident 

  • Group: Members
  • Posts: 144
  • Joined: 08-March 10

Posted 20 September 2010 - 02:57 PM (#16)

View PostKyek, on 20 September 2010 - 11:09 AM, said:

Interesting! That's the first I've heard that. I'm not sure I follow the logic, though -- because with the salt-last algorithm, wouldn't it be just as easy to calculate the salt once and then prepend the brute attack?


MD5( A) works O(n) from left to right of input A, with a growth rate of n which is smaller than the growth rates of MD5( B) and MD5( C) where A = B C.

If you want an English explanation: MD5 works from left to right on the input. If your salt comes first, a brute forcer can save the state of the algorithm (in particular, the current content of the initialization vector) and resume from that position when it evaluates md5($password) for every $password it is bruteforcing.

If you place the salt afterwords, it must process the md5($password) and then process the md5($salt). Following me?
2


User is offline Mack 

  • http://mackgoodstein.com/
  • Group: Members
  • Posts: 2070
  • Joined: 08-March 10
  • Expertise:HTML,CSS,PHP,Javascript

Posted 20 September 2010 - 03:08 PM (#17)

You said that no type is more secure then the other. That is not true, as md5 has a higher chance of colliding then others. Its a low chance, but I have seen it happen
0


User is offline magik 

  • magikly delicious
  • Group: Members
  • Posts: 1095
  • Joined: 08-March 10
  • Expertise:HTML,PHP,Javascript,SQL

Posted 20 September 2010 - 03:10 PM (#18)

View PostDissident, on 20 September 2010 - 02:57 PM, said:

MD5( A) works O(n) from left to right of input A, with a growth rate of n which is smaller than the growth rates of MD5( B) and MD5( C) where A = B C.

If you want an English explanation: MD5 works from left to right on the input. If your salt comes first, a brute forcer can save the state of the algorithm (in particular, the current content of the initialization vector) and resume from that position when it evaluates md5($password) for every $password it is bruteforcing.

If you place the salt afterwords, it must process the md5($password) and then process the md5($salt). Following me?


Ohhhhh I see it now! If one were to brute force using a specific char range/length range, then a hacker could speed up the calculations by not just re-calcing the entire MD5, but instead branching off the "states" and adding different string inputs after these branches. Saving the hacker form having to re-calc all the data that's been hashed so far ( that was the same string input ).

Ingenious!


View PostMack, on 20 September 2010 - 03:08 PM, said:

You said that no type is more secure then the other. That is not true, as md5 has a higher chance of colliding then others. Its a low chance, but I have seen it happen

rate of collision != security

they are related, but not synonymous - less collisions != more security, just as more collisions != less security. They aren't related like that.

if you read Kyek's post, you would notice that he mentions that you want a hash that DOES collide. What you have to think about is that all hashes collide, it's a fact of their nature. What the different hashes change though, is the rate of collision. If you use a longer hash, it is less likely to collide, but you WANT collisions. Not enough collisions that a string of say password length collides with another string of password length, but enough that when you md5 a salt + password, that there ARE collisions - so that brute forcing would produce false positives.
.... magik's most awesomely rainbowed signature =þ


the wdR forums, on crack rocks, said:

Your signature may contain:
  • Any number images
  • Images of any size
  • Any number of URLs
  • Any number of lines

dangerous...
0


User is offline Dissident 

  • Group: Members
  • Posts: 144
  • Joined: 08-March 10

Posted 20 September 2010 - 03:14 PM (#19)

View PostMack, on 20 September 2010 - 03:08 PM, said:

You said that no type is more secure then the other. That is not true, as md5 has a higher chance of colliding then others. Its a low chance, but I have seen it happen


I don't think Kyek meant to say MD5 was more secure than others, like SHA1, and that he is by no means trying to promote use of MD5. He's just saying that when it comes to password hashing, some people seem to think all of their problems go away if they replace md5 with something else.

Kyek's point is that instead people should be focusing on salting passwords rather than using a different hash algorithm, since the majority of attacks against passwords are brute-forcing attacks.
0


User is offline BokTheGolem 

  • Group: Members
  • Posts: 668
  • Joined: 04-April 10

Posted 20 September 2010 - 03:17 PM (#20)

View PostMack, on 20 September 2010 - 03:08 PM, said:

You said that no type is more secure then the other. That is not true, as md5 has a higher chance of colliding then others. Its a low chance, but I have seen it happen


Didn't he talk a lot about collisions or did is misread or did you not read? Not being mean just saying.
As it said ALL hashing functions have a chance for collision, ALL. Shorter hashes such as 32 bit collide more than higher hashes like 256. However having some collisions can be helpful for such things as rainbow tables where collision can cause it to loop? Thats what I got from it. Makes sense

Also hashes and things like random numbers are one thing I could never get my head around.
Like for random functions (i'm not 100% sure how this works so just going off what I know) there are many which allow you to retain the "random seed" with which the function generates the random number. Therefore it seems statistically possible to be able to guess a random number from this random seed or at least derive some sort of guess from it.

And same thing with hashing, some sort of function hashes it so is it simply not possible to reverse said function? I know it'd be insanely hard but computer wise I can just never understand how a computer can do things one way and not the other. It can;t possibly generate parts of a hash randomly else there would be random collisions and the hash could be different every time Furthermore the mere presence of collisions proves that the hash must have some sort of common method which could possibly be reversed. If it does it bit by bit could an analysis of two colliding hashes not see some sort of way to reverse?

I guess i'd need to take some college course on these things to understand :P Maybe asking a bit too much knowledge :P

Wow in the time it took me to write this two more posts have popped up :P

Also to the poster above while he is not expressly saying use MD5 he does say for a language like php it is faster and has no downside to say SHA-1. Just saying that because it sounds like you still have some negative connotations associated with MD5, but maybe im wrong. Just from what I read from this MD5 == perfectly acceptable and even faster and just as secure on php.
"You can't make me look! I'll just shut my eyes."
"Oh, you'll open them. You have to breath sometime. "
0


Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services