Jump to content

Re: md5($plainpass[1])


ssjrocks

Recommended Posts

<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
$invalid = '0';
echo '<center><a href="view.php">Browse</a>|<a href="search.php">Search</a>|<a href="update.php">update</a>|</center><BR><BR><BR>';


echo str_repeat(' ', 256).'<pre>'; flush();
ob_start();
include('sql.php');
include('functions.php');
mysql_select_db($dbname, $con);
$nh = '0';
$ru = '0';
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }


$pp = $_POST["data"];
$delim = $_POST["delim"];
$last = '0';


$data = explode("\n", $pp);
$resultf = array_unique($data);
$tot = count($resultf);
$dupl = count($data) - count($resultf);
echo $dupl . ' Duplicates Removed... Processing ' . $tot . ' Records.';
echo '<BR><BR>';

create_progress();
$counter = '0';
foreach ($resultf as $line) {
$plainpass = explode($delim, $line);
++$counter;
if (md5($plainpass[1]) != $plainpass[0]){
++$invalid;
next($resultf);

}




if(recordExists('passhash',$plainpass[0])){

mysql_query("UPDATE megatable SET plainpass = '" . $plainpass[1] . "' WHERE passhash = '" . $plainpass[0] . "' AND plainpass = ''");

$ru = $ru + mysql_affected_rows();

}
else{
mysql_query("INSERT INTO megatable (passhash, plainpass) VALUES ('" . $plainpass[0] . "', '" . $plainpass[1] . "')");
$nh = $nh + mysql_affected_rows();


}
$prog = $counter / $tot * 100;
$prog = round($prog);
if($last != $prog){update_progress($prog);}

$last = $prog;
unset($resultf[$last]);
}
mysql_close($con);
echo '<BR>done';
echo '<BR>' . $nh . ' New Hashes added to Db';


echo '<BR>' . $ru . 'Hashes  Updated with plainpass';
echo '<BR>From ' . $tot . ' Unique inputs';
echo "<BR>" . $invalid . " Illegal Entries Ignored.<BR>";
echo '<BR><BR>';
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo 'Page generated in '.$total_time.' seconds.'."\n";
?> 

 

 

 

 

 

im having problems around the if (md5($plainpass[1]) != $plainpass[0]){ line

if i import 5000 records it replies that 4999 are illegal entried ...(the md5 of the plainpass does not match data supplie... even tho i know it does)

any help would be apreciated

i have checked and i am sending clean data to the script no spaces \n's or anything like that

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.