Author Topic: What is the point of MD5?  (Read 32222 times)

0 Members and 2 Guests are viewing this topic.

Offline MadTechie

  • Guru
  • Freak!
  • *
  • Posts: 9,374
  • Gender: Male
  • I try to F1
    • View Profile
Re: What is the point of MD5?
« Reply #60 on: May 29, 2009, 09:59:02 PM »
editr
« Last Edit: May 29, 2009, 10:00:38 PM by MadTechie »
Computers are good at following instructions, but not at reading your mind.
The quality of a response, is usually directly related to the quality of the question. ©2009 mjdamato
I dunno about that.  A regular expression has a 0% chance of touching my penis.
the code is professionally made up but not working
Remember to Click Solved, how to ask questions - the smart way

Offline .josh

  • Administrator
  • 'Insane!'
  • *
  • Posts: 13,152
  • Grumpy Old Man
    • View Profile
Re: What is the point of MD5?
« Reply #61 on: May 29, 2009, 10:03:46 PM »
While thats kinda true, using MD5 over MD5 stopes that so if a collision is found its useless!
plus theirs a differents between getting into someones account and getting their "password".

yeah..there's a difference as far as words your physically using when stating it.  In principle though, its the same thing, as the point of getting someone's password is to get into their account, because the point of passwords is to restrict people from getting into things.  I will preemptively agree that you can potentially do a lot more damage with the real password than a string that shares the same hash.  That would largely depend on how stupid the user is as far as using the same password for lots of different places and the how different systems go about validating passwords (which is, as mentioned, pretty common for sites to just do a string comparison on the hash).

Did I help you? Feeling generous? Donate to me! | Donate to phpfreaks!

Offline MadTechie

  • Guru
  • Freak!
  • *
  • Posts: 9,374
  • Gender: Male
  • I try to F1
    • View Profile
Re: What is the point of MD5?
« Reply #62 on: May 29, 2009, 10:18:54 PM »
Last post:
While that's kinda true, using MD5 over MD5 stops that so if a collision is found its useless!
plus theirs a differences between getting into someones account and getting their "password".

there has never been a collision found yet for an MD5 hash.
REALLY!
Oh look here!
Code: [Select]
<?php
echo md5_file(dirname(__FILE__)."/file0.txt");
echo 
"<br>\n";
echo 
md5_file(dirname(__FILE__)."/file1.txt");
Quote
a4c0d35c95a63a805915367dcfe6b751<br>
a4c0d35c95a63a805915367dcfe6b751

@gevans:
You increase the odds in the second one, however i also use MD5 over MD5
the second code has a 1 in 1.4972881278886E-19 chance of a collision (that's if salt isn't used)
to workout the chances of the first or with salt your need to take into account the min to max length of the salt and password.

New: post
Reply to CV:
Well this the main part, this whole thread is about "cracking MD5", not about getting into accounts. no matter what you use, if you allow little common passwords and the user uses them, well that's nothing to do with the encryption strength!

NB:Also by adding salt that makes the password harder as the reversed hash would be password+salt, so if the salt was 128chars, then thats a long password, but its nothing to do with MD5!

[attachment deleted by admin]
« Last Edit: May 29, 2009, 10:26:21 PM by MadTechie »
Computers are good at following instructions, but not at reading your mind.
The quality of a response, is usually directly related to the quality of the question. ©2009 mjdamato
I dunno about that.  A regular expression has a 0% chance of touching my penis.
the code is professionally made up but not working
Remember to Click Solved, how to ask questions - the smart way

Offline Daniel0

  • Administrator
  • 'Insane!'
  • *
  • Posts: 11,815
  • Gender: Male
  • ^bb|[^b]{2}$
    • View Profile
Re: What is the point of MD5?
« Reply #63 on: May 30, 2009, 04:32:26 AM »
I have to partially agree with rv20 for the isolated incident of it not mattering whether you know which of the two strings is the "right" password if they both share the same hash.  (Most) scripts are written to compare the stored hash with the generated hash from what the user inputs into the login prompt.  So if user's password is "foo" and it generates a hash of 12345 and I figure out that the hash is 12345 and I "reverse engineer" it and come up with "bar" and enter that into the login prompt... well as far as the login script is concerned, 12345 == 12345. 

That is true, but never disputed in this topic as far as I'm concerned. We're disputing the fact that he claims that hashing algorithms can be cracked.

If he still believes it to be true, here is another challenge. The following is a hashing algorithm:
function hashMod10($n)
{
	
return 
$n 10;
}

If I run my cell phone number through that hashing algorithm I'll get the hash "4". Now send me a text message or give me a call. I'm looking forward to hearing from you.

Offline waynewex

  • Addict
  • Posts: 2,364
  • Gender: Male
    • View Profile
    • Web Design Wexford
Re: What is the point of MD5?
« Reply #64 on: May 30, 2009, 05:01:32 AM »
I'm locking this thread now.

Offline gevans

  • Addict
  • Posts: 2,649
  • Gender: Male
  • don't shoot the messanger
    • View Profile
    • Guernsey Web Design
Re: What is the point of MD5?
« Reply #65 on: May 30, 2009, 06:42:22 AM »
@gevans:
You increase the odds in the second one, however i also use MD5 over MD5
the second code has a 1 in 1.4972881278886E-19 chance of a collision (that's if salt isn't used)
to workout the chances of the first or with salt your need to take into account the min to max length of the salt and password.

I increase the odds of collision in the second one where md5 is only used once? I thought after reading this thread that it would be the other way around. If that is the case I'll stick with the original option which hashes a password, attaches a salt and hashes the resulting (hash + salt).
I like starting my code with session_start();

Code: [Select]
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
Son of a biscuit eating bulldog
Use [code][/code] tags!!

Offline MadTechie

  • Guru
  • Freak!
  • *
  • Posts: 9,374
  • Gender: Male
  • I try to F1
    • View Profile
Re: What is the point of MD5?
« Reply #66 on: May 30, 2009, 07:17:12 AM »
@gevans:
Sorry, i had to write that post about twice, i meant to say the first one, basically where your hashing are 15 charsator set string of 32 charator compared to X length.

re-typed:
You increase the odds when you use MD5 over MD5, however i also use MD5 over MD5
this will have a 1 in 1.4972881278886E-19 chance of a collision (that's if salt isn't used)
to workout the chances of the first or with salt your need to take into account the min to max length of the salt and password.

I'm locking this thread now.
Forum Rules
14. Users will not act as though they are staff members,
« Last Edit: May 30, 2009, 07:21:48 AM by MadTechie »
Computers are good at following instructions, but not at reading your mind.
The quality of a response, is usually directly related to the quality of the question. ©2009 mjdamato
I dunno about that.  A regular expression has a 0% chance of touching my penis.
the code is professionally made up but not working
Remember to Click Solved, how to ask questions - the smart way

Offline DarkSuperHero

  • Enthusiast
  • Posts: 340
  • Gender: Male
    • View Profile
    • PHP Video Tutorials
Re: What is the point of MD5?
« Reply #67 on: May 30, 2009, 01:41:28 PM »
so would it be advisable to do and md5 of the password phrase, and then maybe store an encrypted version of the password phrase, and when some one tried to login you would compare both the hashed and the encrypted version for a match, not allowing the user to know your making two comparisons?

This would protect from they md5 collision problem... or would this be totally pointless?

Offline MadTechie

  • Guru
  • Freak!
  • *
  • Posts: 9,374
  • Gender: Male
  • I try to F1
    • View Profile
Re: What is the point of MD5?
« Reply #68 on: May 30, 2009, 03:32:30 PM »
Add encryption would help against collisions but would weaken the whole point, its like saying keep the plain text version as well!
Encrypted data can be cracked (reverted back to the original state) One way encrypted data can not be converted back for example if i used DES256 and encrypted a 400 page word document and have you the password you could get that document original contents, but it i used MD5 your have 32 character string.. you could brute force but lets be practical that's going to take years (i'm not even going to take a guess how long), its like trying to clone a human from a fingerprint..

However if you want to highly reduce the collision factor theirs a simple route, store 2 hash's each with a different salt,

But with that said, i must stress that MD5 is not the only part of a log-in process allowed chartors and password length are also major parts, to breaks someones password is one thing, but to break it from a hash is  another, its more likely they will try to bruteforce from the log-in screen, as they shouldn't be able to get he hash,
The hash only really takes affect once your system is already compromised.
Computers are good at following instructions, but not at reading your mind.
The quality of a response, is usually directly related to the quality of the question. ©2009 mjdamato
I dunno about that.  A regular expression has a 0% chance of touching my penis.
the code is professionally made up but not working
Remember to Click Solved, how to ask questions - the smart way

Offline DarkSuperHero

  • Enthusiast
  • Posts: 340
  • Gender: Male
    • View Profile
    • PHP Video Tutorials
Re: What is the point of MD5?
« Reply #69 on: May 30, 2009, 04:32:46 PM »
Add encryption would help against collisions but would weaken the whole point, its like saying keep the plain text version as well!
[...]
The hash only really takes affect once your system is already compromised.

Good Points! It was one of those it seemed like a good idea at the moment things...so it really does boil down to making sure your system isnt compromised...eg. ''In winter time, closing the door wont keep the warmth in if the window is open..''... :-)

Offline Daniel0

  • Administrator
  • 'Insane!'
  • *
  • Posts: 11,815
  • Gender: Male
  • ^bb|[^b]{2}$
    • View Profile
Re: What is the point of MD5?
« Reply #70 on: May 30, 2009, 04:34:03 PM »
Still though, hope for the best, plan for the worst. This is true in particular with programming.

Offline keenyounglearner

  • Irregular
  • Posts: 6
    • View Profile
Re: What is the point of MD5?
« Reply #71 on: June 12, 2009, 06:43:58 AM »
Could someone explain what the point of a one-way hash function like this is? Why would I hash a password if I can never get the original value back?

Offline Daniel0

  • Administrator
  • 'Insane!'
  • *
  • Posts: 11,815
  • Gender: Male
  • ^bb|[^b]{2}$
    • View Profile
Re: What is the point of MD5?
« Reply #72 on: June 12, 2009, 06:46:01 AM »
Let me turn the question around: Why would you want the value back?

Offline keenyounglearner

  • Irregular
  • Posts: 6
    • View Profile
Re: What is the point of MD5?
« Reply #73 on: June 12, 2009, 12:48:22 PM »
Well I store the users password in my DB on registration then I want to match it again his enterred password upon login. Or is the point to just go if(md5(enterredPassword) == $storedDBHas) { login=true; }

Offline Daniel0

  • Administrator
  • 'Insane!'
  • *
  • Posts: 11,815
  • Gender: Male
  • ^bb|[^b]{2}$
    • View Profile
Re: What is the point of MD5?
« Reply #74 on: June 12, 2009, 01:01:59 PM »
Or is the point to just go if(md5(enterredPassword) == $storedDBHas) { login=true; }

Yes.