Reply to Re: faster way to get from SQL database into array

Your name:

Reply:


Posted by Norman Peelman on 12/13/06 04:22

"Toby Inkster" <usenet200611@tobyinkster.co.uk> wrote in message
news:f91454-2rt.ln1@ophelia.g5n.co.uk...
> Norman Peelman wrote:
>
> > The odds of any two strings having the same md5 are on the order of 2^64
> > operations.
>
> The odds of any two *given* strings having the same MD5 are about 3.4E-38.
>
> The odds that some two strings have the same MD5 are 1. On a modern
> computer, you should be able to calculate a "collision" in minutes.
> <http://www.links.org/?p=6>
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~ http://tobyinkster.co.uk/contact
>

Ok, not sure what's going on (read a bunch of posts concerning collisions)
but I cannot reproduce the output of the link above. Give the two separate
strings I get two different hashes:

simple script to show differences in input strings and the md5 hashes

<?php
$str1 =
'd131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f
4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd
436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69
821bcb6a8839396f9652b6ff72a70';
$str2 =
'd131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f
4b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd
436c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec69
821bcb6a8839396f965ab6ff72a70';
$md51 = md5($str1);
$md52 = md5($str2);

$str_diffs = show_diff($str1, $str2);

echo '<pre>';
echo "$str_diffs<br>";
echo "$str1<br>";
echo 'Length: '.strlen($str1).'<br>';
echo "md5: $md51<br>";
echo 'md5 length: '.strlen($md51).'<br>';
echo "$str2<br>";
echo 'Length: '.strlen($str2).'<br>';
echo "md5: $md52<br>";
echo 'md5 length: '.strlen($md52).'<br>';
echo '</pre>';
echo '<br>';

function show_diff($str1, $str2)
{
$str1_tmp = '';
$str2_tmp = '';
for ($loop = 0; $loop <= strlen($str1)-1; $loop++)
{
if ($str1{$loop} != $str2{$loop})
{
$font_start = '<font color="red">';
$font_end = '</font>';
}
else
{
$font_start = '';
$font_end = '';
}
$str1_tmp .= $font_start.$str1{$loop}.$font_end;
$str2_tmp .= $font_start.$str2{$loop}.$font_end;
}
$final = $str1_tmp.'<br>'.$str2_tmp.'<br>';
return $final;
}
?>

output:

d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4
b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd4
36c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec698
21bcb6a8839396f9652b6ff72a70

d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4
b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd4
36c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec698
21bcb6a8839396f965ab6ff72a70


d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4
b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd4
36c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec698
21bcb6a8839396f9652b6ff72a70

Length: 256

md5: edde4181249fea68547c2fd0edd2e22f

md5 length: 32

d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4
b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd4
36c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec698
21bcb6a8839396f965ab6ff72a70

Length: 256

md5: e234dbc6aa0932d9dd5facd53ba0372a

md5 length: 32



Is it possible this has been fixed (running PHP4.3.4) as I notice the post
is from 2005... Or am I not looking at something right?

Norm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация