<?php
	if (!extension_loaded('infosec'))
        {
                if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
                {
                        dl('php_infosec.dll');
                }
                else
                {
                        dl('infosec.so');
                }
        }
        else
        {
                echo "loaded infosec module success<br/>";
        }


	if(isset($_POST["desdec"]))
	{
		$enc=$_POST["enc"];
		if(strlen($enc) <= 0)
		{
			echo "WARNING : no input data<br/>";
			exit();
		}
		$data = base64dec($enc);
		$key=$_POST["key"];
                if(strlen($key) <= 0)
                {
                        echo "WARNING : no input key<br/>";
			exit();
                }
		$desdec = desDecrypt(current($data),$key);
		#echo $desdec,"<br/>";
		echo "source data : ",current($desdec),"<br/>";
		echo "source data len: ",next($desdec),"<br/>";
	}
	exit();
?>

