More strict ownership asserts
[mirrors/Programs.git] / php / skripty / md5crack.php
1 <?php
2
3 /* Example for password "czISc.fWfjsQQ" ("admin"):
4 * $salt = ("cz"); //First two characters of password
5 * $hash = ("ISc.fWfjsQQ"); //Rest of password
6 */
7
8
9 $salt = ("cz"); //First two characters of password
10 $hash = ("ISc.fWfjsQQ"); //Rest of password
11 $pass = ("admin"); //Debug only (Contains known password)
12
13 //////////////////////////////////////////////////////////////////////////////
14
15 //READLINE Function
16 function readline($prompt="") {
17 echo $prompt;
18
19 $t = "";
20 $c = "";
21
22 while(1) {
23 $c = fread(STDIN, "1");
24 if ($c == "\n") { // && ($c == "\r") //May be later on oher systems
25 return trim($t);
26 } else {
27 $t = ($t.$c);
28 }
29 }
30
31 return $t;
32
33 }
34 //READLINE End
35
36 //CODE
37 $loop = 1;
38 while($loop) {
39
40 $try = readline();
41
42 //$try = $pass; //Debug only
43 $crypt = crypt($try, $salt);
44 if ( $crypt == ($salt.$hash) ) {
45 echo ("\nSalt: $salt\nHash: $hash\nPass: $try\n\n");
46 }
47
48 }
49
50 ?>
This page took 0.256652 seconds and 4 git commands to generate.