Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('START', 32);
- define('END', 126);
- define('MAX_LEN', 8);
- $pass = array(chr(START), chr(START), chr(START));
- $len = count($pass);
- $end = false;
- while (!$end) {
- if (crypt(implode('', $pass), 'wM') == "wMIYWuxuDO0Kc") {
- echo 'OK! C=' . implode('', $pass) . "\n";
- break;
- }
- $end = nextPass($pass, 0);
- }
- function nextPass(&$pass, $i) {
- if (count($pass) <= $i) {
- if ($i >= MAX_LEN) {
- return true;
- } else {
- $pass[] = chr(START);
- }
- } else {
- $code = ord($pass[$i]);
- if ($code > END) {
- $pass[$i] = chr(START);
- return nextPass($pass, $i + 1);
- } else {
- $pass[$i] = chr($code + 1);
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement