<?php
/**
* Script provides form to decode encrypted header information.
*
* @copyright 2005-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: decrypt_headers.php 14840 2020年01月07日 07:42:38Z pdontthink $
* @package squirrelmail
*/
/**
* Set constant to path of your SquirrelMail install.
* @ignore
*/
/**
* include SquirrelMail string and generic functions
* script needs OneTimePadDecrypt() (functions/strings.php)
* and sqgetGlobalVar() (functions/global.php)
*/
include_once(SM_PATH.'functions/global.php');
include_once(SM_PATH.'functions/strings.php');
/**
* converts hex string to ip address
* @param string $hex hexadecimal string created with squirrelmail ip2hex
* function in delivery class.
* @return string ip address
* @since 1.5.1 and 1.4.5
*/
} elseif (strlen ($hex)==
32) {
} else {
$ret=$hex;
}
return $ret;
}
/** create page headers */
header ('Content-Type: text/html');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'
."\n<head>\n<meta name=\"robots\" content=\"noindex,nofollow\">\n"
."</head><body>";
$continue = TRUE;
empty($secret)) {
$continue = FALSE;
echo "<p>You must enter an encryption key.</p>\n";
}
empty($enc_string)) {
$continue = FALSE;
echo "<p>You must enter an encrypted string.</p>\n";
}
if ($continue) {
echo "<p>Encrypted string should be BASE64 encoded.<br />\n"
."Please enter all characters that are listed after header name.</p>\n";
} elseif (isset($secret)) {
}
}
}
echo "<hr />";
}
?>
<form action="<?php echo $PHP_SELF ?>" method="post" >
<p>
Secret key: <input type="password" name="secret"><br />
Encrypted string: <input type="text" name="enc_string"><br />
<label for="ip_addr">Check here if you are decoding an address string (FromHash/ProxyHash): </label><input type="checkbox" name="ip_addr" id="ip_addr" /><br />
<button type="submit" name="submit" value="submit">Submit</button>
</p>
</form>
</body></html>