<?
include("encdec.php");
$enc = new encdec();
$data=$HTTP_POST_VARS['data'];
$dec=$HTTP_POST_VARS['decryption'];
$key=$HTTP_POST_VARS['pwd'];
$e='';
if ($dec=='fals')
{
$e = $enc->encrypt($data,$key);
echo '<h2> Result= '.urldecode($e).'</h2><br/><br/>';
}
else
{
$d = $enc->decrypt($dec,$key);
echo '<h2> Result= '.urldecode($d).'</h2><br/><br/>';
}
?>
<html>
<head>
<title>Encryption</title>
</head>
<body>
<h2>Encryption</h2><br/>
<form method="post" action="example3.php">
<input type="hidden" name="decryption" value="fals"/>
<input type="text" name="data" value="www.stekpi.ac.id"/> Data
<br/>
<input type="text" name="pwd" value="agus"/> Key
<br/>
<input type="submit" value="Encrypt">
</form>
<br/><br/>
<h2>Decryption</h2><br/>
<form method="post" action="example3.php">
<input type="hidden" name="data" value="fals"/>
<input type="text" name="decryption" value="<?=urldecode($e);?>"/> Data
<br/>
<input type="text" name="pwd" value="<?=$key;?>"/> Key
<br/>
<input type="submit" value="Decrypt">
</form>
</body>
</html>
|