Does MD5 work cross-platform?

This is a discussion on Does MD5 work cross-platform? within the PHP Language forums, part of the PHP Programming Forums category; Kailash Nadh wrote: > On Nov 23, 7:13 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk> > ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 11-26-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Does MD5 work cross-platform?

Kailash Nadh wrote:
> On Nov 23, 7:13 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
> wrote:
>> Rik Wasmus wrote:
>>> You can't decrypt/decode it though (well, at least not practically).

>> Well, you can't at all, because for any given MD5 hash, there are infinite
>> possible inputs which could have generated it. So even if you manage to
>> find an input which produces that value as its output (which is more or
>> less an enormous brute-force search), you can't be sure that it's the same
>> as the original input.
>>
>> --
>> Toby A Inkster BSc (Hons) ARCS
>> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
>> [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 1 day, 9 min.]
>>
>> It'll be in the Last Place You Look
>> http://tobyinkster.co.uk/blog/2007/11/21/no2id/

>
>
> Toby, I think you are mistaken.
> In theory, every md5 hash is unique. An md5 hash is bound to a single
> unique input. If a brute-force matches a has, THAT is the original
> input.
>
> Regards,
> Kailash Nadh
> http://kailashnadh.name
>


(Top posting fixed)

Wrong. A MD5 hash results in a 32 byte value. Theoretically there are
a (near) infinite number of hashes which can be resolved to a the same
hash. If it were unique, it would be the best compression algorithm
known to programmers.

And please don't top post. Thanks.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
  #12 (permalink)  
Old 11-26-2007
Kailash Nadh
 
Posts: n/a
Default Re: Does MD5 work cross-platform?

On Nov 26, 4:08 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> KailashNadhwrote:
> > On Nov 23, 7:13 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
> > wrote:
> >> Rik Wasmus wrote:
> >>> You can't decrypt/decode it though (well, at least not practically).
> >> Well, you can't at all, because for any given MD5 hash, there are infinite
> >> possible inputs which could have generated it. So even if you manage to
> >> find an input which produces that value as its output (which is more or
> >> less an enormous brute-force search), you can't be sure that it's the same
> >> as the original input.

>
> >> --
> >> Toby A Inkster BSc (Hons) ARCS
> >> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
> >> [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 1 day, 9 min.]

>
> >> It'll be in the Last Place You Look
> >> http://tobyinkster.co.uk/blog/2007/11/21/no2id/

>
> > Toby, I think you are mistaken.
> > In theory, every md5 hash is unique. An md5 hash is bound to a single
> > unique input. If a brute-force matches a has, THAT is the original
> > input.
> >
> > Regards,
> >KailashNadh
> >http://kailashnadh.name
> >

>
> (Top posting fixed)
>
> Wrong. A MD5 hash results in a 32 byte value. Theoretically there are
> a (near) infinite number of hashes which can be resolved to a the same
> hash. If it were unique, it would be the best compression algorithm
> known to programmers.
>
> And please don't top post. Thanks.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================


Ah, my mistake.

Regards,
Kailash Nadh
http://kailashnadh.name
Reply With Quote
  #13 (permalink)  
Old 11-27-2007
Toby A Inkster
 
Posts: n/a
Default Re: Does MD5 work cross-platform?

Kailash Nadh wrote:

> In theory, every md5 hash is unique. An md5 hash is bound to a single
> unique input. If a brute-force matches a has, THAT is the original
> input.


As everyone else has pointed out, MD5s are not unique. Here's a thought
experiment which proves it.

An MD5 is a 128-bit number. Thus there are 2^128 possible MD5 outputs.

If we consider all possible files of length 17 bytes (136 bits), then
you'll notice that there are 2^136 possible MD5 inputs.

Now, (2^136)/(2^128) = 2^8 = 256. Which means that for every MD5 input,
there are (on average) 256 different files of length 17 bytes which can
produce that result.

And that's just collisions with files of length 17 bytes. When you
consider files with length 18 bytes, there are over 65000 collisions for
each MD5 result. Imagine how many possible collisions there are with files
in the kilobyte or megabyte size range!

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 2 days, 14:54.]

It'll be in the Last Place You Look
http://tobyinkster.co.uk/blog/2007/11/21/no2id/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:25 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0