Login   Register  
PHP Classes
elePHPant
Icontem

File: example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Nima Nima  >  Text Iterator  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Example 2
Class: Text Iterator
Iterate over a text string for external processing
Author: By
Last change: .
Date: 2011-06-23 13:29
Size: 1,100 bytes
 

Contents

Class file image Download
<?php
/**
* Brute Force Search Class
*
* @package   Brute Force Search Class
* @file      example2.php
* ****************************************************************************
* Allright! We gonna use this class to find a md5 output!
* We will search for db088d7fd61422d0dd9f2152fd550127
* which is actually md5 string of nima
*/

@set_time_limit(0); //This might be useful. Searching might take too long!

require_once("brute_force.class.php");

function 
check_md5($md5$i)
{
    if(
md5($md5) == "db088d7fd61422d0dd9f2152fd550127")
    {   
        echo 
"Hey! I finally found it after searching total of $i strings! it's \"$md5\" you are looking for! (without quotes)\n";
        return 
true;
    }
}

$brute_force = new brute_force("check_md5"34"lower") or die($brute_force->errormsg()); //We are searching for 3 and 4 length strings which contain only lowercase characters!
$brute_force->callback_break true//By setting this to true, process will terminate whenever callback function returns true (refer to the documentation)
$brute_force->search();
?>