<?php
include('Crypter_V2.php'); //Include le funzioni di criptazione
if ( IsSet( $_POST['FileIn'] ) and IsSet( $_POST['FileOut'] ) and IsSet( $_POST['password'] ) )
{
if ( $_POST['action'] == "Cifra" )
{
if(X_Crypt_File($_POST['FileIn'],$_POST['FileOut'], $_POST['password'], TRUE ))
echo "Il file : " . $_POST['FileIn'] . " è stato cifrato con successo ";
else
echo "Impossibile cifrare il file : " . $_POST['FileIn'];
}
if ( $_POST['action'] == "Decifra" )
{
if(X_DeCrypt_File($_POST['FileIn'],$_POST['FileOut'], $_POST['password'], TRUE ))
echo "Il file : " . $_POST['FileIn'] . " è stato decifrato con successo ";
else
echo "Impossibile decifrare il file : " . $_POST['FileIn'];
}
}
?>
<html>
<head>
<title>Php Crypt Module - Example </title>
<meta name="AUTHOR" content="Ugo Cirmignani">
<meta name="description" content="Password crypter module">
<link href="lib/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width=755 align="center">
<tr><td class="tm">
<center><img src="lib/logo.png"></center>
</td></tr>
<tr><td class="tm">
<center><font> Crypter module test </font></center>
</td></tr>
</table>
<table width=755 align="center">
<tr><td class="tx">
<br>
<center>
<h3> String Crypt Example </h3>
<form method=post action="index.php">
<br>
<font face="verdana" size="3"> <b> Type a password: </b> </font>
<input name="password" type="text" size="50" value="<?php if (IsSet( $_POST['password'] )) echo $_POST['password']; ?>"><br><br>
<br>
<font face="verdana" size="3"> <b> Text to Crypt / Decrypt </b> </font>
<br><br>
<textarea name="testo" cols="60" rows="10">
<?php
if ( IsSet( $_POST['testo'] ) and IsSet( $_POST['password'] ) )
{
$Testo = $_POST['testo'];
$Passw = $_POST['password'];
if ( $_POST['action'] == "Crypt" )
$Testo = X_Crypt_String( $Testo, $Passw, TRUE );
if ( $_POST['action'] == "Decrypt" )
$Testo = X_DeCrypt_String( $Testo, $Passw, TRUE );
echo $Testo;
}
?></textarea>
<br>
<input name=action type=submit value="Crypt">
<input name=action type=submit value="Decrypt">
</form>
<br>
</center>
<hr>
<center>
<h3> Costumized Hash Function Tester </h3>
<br>
<form method="post" action="index.php">
<font face="verdana" size="3"> <b> String to encode : </b> </font> <input name="hash" type="text" size="40" value="<?php
if ( IsSet( $_POST['hash'] ) )
{
if ( $_POST['hash'] != "" ){
$hashato = $_POST['hash'];
$Testo = x_Hash( $_POST['hash'] );
}
}
if (isset($_POST['hash']) && $_POST['hash'] != "")
echo $hashato
?>">
<input name="action" type="submit" value="X_Hash">
</form>
<?
if ( isset($_POST['hash']) && $_POST['hash'] != "" )
echo "<font color=\"red\" size=\"2\" face=\"verdana\"><b> X_Hash : </b></font> <font color=\"red\" size=\"2\" face=\"verdana\"> " . $Testo ." </font><br><br>";
?>
</center>
</tr></td>
</table>
<table width="755" align="center">
<tr><td class="tm">
<font face="verdana" size="3"><center>By Ugo Cirmignani - ask info to </font> <a href="mailto:hide@address.com">hide@address.com</a></center>
</td></tr>
</table>
</body>
</html>