0

whats wrong with this code : its not showing the output result

<!DOCTYPE html> <html> <head> <title>Mohammad ALshoubasi</title> </head> <body> <h1>MD5 Cracker</h1> <p>This application takes an MD5 hash of a two-character lower case string and attempts to hash all two-character combinations to determine the original two characters.</p> <pre> Debug Output : <?php $output = "Not Found"; if ( isset($_GET['md5'])) { $time_pre = microtime(true); $md5 = $_GET['md5']; $txt ="abcdefghijklmnopqrstuvwxyz"; $show = 15; for ($i=0; $i <strlen($txt) ; $i++) { $ch1 = $txt[$i]; for ($j=0; $j <strlen($txt) ; $j++) { $ch2 = $txt[$j]; $try = $ch1.$ch2; $check = hash('md5', $try); if ($check == $md5) { $output = $try; break; } if ($show > 0) { print "$check $try\n"; $show = $show - 1; } } } } $time_post = microtime(true); print "elapsed time: "; print $time_post-$time_pre; print "\n"; ?> </pre> <p>Original Text : <?= htmlentities($output);?></p> <form method="_GET"> <input type="Text" name="md5" size="50"> <input type="submit" value="Crack md5"> </form> </body> </html>

27th Mar 2020, 3:56 PM
Mouhamad Shoubasi
Mouhamad Shoubasi - avatar
1 Resposta
0
Perhaps need to use break(2); instead break? Currently your 1st level loop clears the right value after it is found.
30th Mar 2020, 6:59 PM
Hello World
Hello World - avatar