Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Open file */
- $lines = file($argv[1]);
- /* Get hash from the first */
- $hash = substr($lines[0], 0, 13);
- unset($lines[0]);
- /* Get the 2 first chars from the hash (salt) */
- $salt = substr($hash, 0, 2);
- /* Preparing list of words */
- $text = preg_replace('/[^a-z ]/', '', strtolower(implode(" ", $lines)));
- $words = array_unique(explode(' ', $text));
- /* Testing possible combinations */
- $glues = array('0', '2', '4', '8');
- $l = array();
- foreach (array_keys($words) as $key) {
- if (isset($words[$key])) {
- $word = $words[$key];
- if (isset($l[$key])) {
- $wlength = $l[$key];
- unset($l[$key]);
- } else {
- $wlength = strlen($word);
- }
- unset($words[$key]);
- if ($wlength && 7 > $wlength) {
- foreach (array_keys($words) as $key2) {
- if (!isset($l[$key2])) $l[$key2] = strlen($words[$key2]);
- $length = $l[$key2] + $wlength;
- if ($length != $wlength) {
- if ($length > 3 && 8 > $length) {
- foreach ($glues as $glue) {
- if (crypt($word.$glue.$words[$key2], $salt) == $hash) {
- echo $word,$glue,$words[$key2],"\n";
- exit;
- } else {
- if (crypt($words[$key2].$glue.$word, $salt) == $hash) {
- echo $words[$key2],$glue,$word,"\n";
- exit;
- }
- }
- }
- }
- } else {
- unset($words[$key2]);
- if (isset($l[$key2])) unset($l[$key2]);
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement