Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

If md5 was not one way?

md5

  • Please log in to reply
6 replies to this topic

#1 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 21 December 2007 - 06:06 AM

If md5 was not one way.. would that mean that if we take the md5 of a file and then reverse it.. would that mean that the file will be regenerated?
  • 0

#2 Guest_Jordan_*

Guest_Jordan_*
  • Guest

Posted 21 December 2007 - 07:22 AM

Yes. It would mean you could determine the code/password from the hash value.
  • 0

#3 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 21 December 2007 - 09:16 AM

It would also mean that MD5 hashes would generally be a similar size to the file. That would make it very impractical for quick checks against changes.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#4 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 21 December 2007 - 10:18 AM

So it would mean that the md5 will be a huge string?
  • 0

#5 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 26 December 2007 - 09:25 AM

Exactly. Think of it this way: if you have 2 million different strings, and the "hash" is to be reversible, then they have to "hash" to 2 million different strings. Now think 2 billion, or 2 trillion. Eventually, your "hash" has to be able to grow.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#6 Crane

Crane

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 388 posts

Posted 26 December 2007 - 02:47 PM

How does a hash work? I mean, what algorithm is it that prevents it from being decoded? The same password must be entered to create the same hash, correct? So why is it not possible to reverse that using the same code????
  • 0

#7 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 27 December 2007 - 09:01 AM

What a hash does is crunch all the data down to a fixed length result string. A fairly simple hash would be to take a string, separate it out into 8 character substrings (padding the final substring up to 8 characters if needed), and then doing a bitwise xor on the substrings.
With a hash like that (we'll call it WP8 hash), the following strings would all have the same hash:
"aaaaaaaabbbbbbbb"
"ababababbabababa"
"aabbaabbbbaabbaa"
because in each case, you are doing an xor on "a" and "b"
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/






Also tagged with one or more of these keywords: md5

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download