//Estimate time to crack:
//4 chars = 6 seconds
//5 chars = 5 minutes
//6 chars = 4 hours
//7 chars = 8 days
//8 chars = 1 year 20 days
Here is the 4 chars version of my password cracker:
<?php
// 8 chars excluded: "&'<>\` and space
$symbol = '!#$%()*+,-./:;=?@[]^_{|}~'; // 25 chars
$number = '0123456789'; // 10 chars
$upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; // 26 chars
$lower = 'abcdefghijklmnopqrstuvwxyz'; // 26 chars
$alfa = $upper.$lower; // 52 chars
$chars = $symbol.$number.$upper.$lower;// 87 chars
// 4 characters password generator
$pw = '';
$pw[0] = $chars[mt_rand(0,86)];
$pw[1] = $chars[mt_rand(0,86)];
$pw[2] = $chars[mt_rand(0,86)];
$pw[3] = $chars[mt_rand(0,86)];
echo '<p style="font-family:\'Courier New\'">';
echo $pw;
echo '<br>';
// The 4 chars password cracker
$ck = '';
for($a=32; $a<127; $a++) {
$ck[0] = chr($a);
for($b=32; $b<127; $b++) {
$ck[1] = chr($b);
for($c=32; $c<127; $c++) {
$ck[2] = chr($c);
for($d=32; $d<127; $d++) {
$ck[3] = chr($d);
if($ck == $pw) {
break(4);
}
}
}
}
}
echo $ck;
exit();