File size: 1.38Kb
<?php
//
// Joe's Encrypter
// Version 1.0
//
// Copyright 2003 Joe Burianek
// [email protected]
// http://www.jbcorps.com
//
// Now works with register globals off!
//
if (isset($_POST['string'])) {
$string = $_POST['string'];
$time = localtime();
$new_time = "$time[2]$time[1]$time[0]";
$b_time = base64_encode($new_time);
$to_crypt = "$b_time$string";
$crypted = md5($to_crypt);
$crypted = "$b_time$crypted";
}
if (isset($_POST['check2'])) {
$check2 = $_POST['check2'];
$check1 = $_POST['check1'];
$old_time = substr($check2, 0, 8);
$to_crypt = "$old_time$check1";
$crypted2 = md5($to_crypt);
$crypted2 = "$old_time$crypted2";
if ($check2 == $crypted2) {
$same = "They are the same!";
} else {
$same = "They are not the same.";
}
}
$msg = "<form action='jcrypter.php' method='POST'>
<input type='text' name='string' length='30'>
<br>
<input type='submit' value='Encrypt'>
</form>
<br><br>
<form action='jcrypter.php' method='POST'>
Original String:<input type='text' name='check1' length='60'><br>
Crypted String:<input type='text' name='check2' length='60'>
<br>
<input type='submit' value='Check'>
</form>";
?>
<html>
<head>
<Title>Joe's Encrypter 1.1</Title>
</head>
<body>
<h3>Joe's Encrypter 1.1</h3>
<?php
echo $msg;
echo "
<br><br>
";
if (isset($crypted)){echo "<p>$crypted</p>";}
if (isset($same)){echo "<p>$same</p>";}
?>
</body>
</html>