Hi I'm building an email activation link for my registered users.. The link contains an id and with its registered email was both encrypted but after the link was clicked it will redirect to a page that will decrypt my message but the decryptor example that was provided by the AES encryption website gives me wrong result when the link retrieves the encrypted variable for the email.. although if I try to use the encrypted variable for the id(with a constant value not from database) it returns me a correct result why..
here is my code
for the decrypting page
$imputText = $_GET['v'];
$imputKey = "3173aLASOf";
$blockSize = 256;
$es = new ES(null, $imputKey, $blockSize);
$es->setData($imputText);
$dec=$es->decrypt();
echo "After decryption: ".$dec."<br/>";
echo "Activated";
but if I change the $_GET['v'];
into a static encrypted message it decrypts correctly
and here the encryption script
$username=$_POST['email'];
$imputText = $username;
$imputKey = "3173aLASOf";
$blockSize = 256;
$es = new ES($imputText, $imputKey, $blockSize);
$enc = $es->encrypt();
$imputText2 = 1;
$es2 = new ES($imputText2, $imputKey, $blockSize);
$enc2 = $es2->encrypt();
$message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> E-mail </title>
</head>
<body bgcolor="#CCCCCC" style="font-weight:300;font-family:"Helvetica Neue", Helvetica, sans-serif;color:#FFFFFF;line-height:18px;margin:0;padding:0;">
<table cellpadding="15" cellspacing="0" border="0" align="center" width="600" bgcolor="#EEEEEE">
<thead style="background:#391E03;">
<th colspan="2" align="justify" style="font-size:14px;color:#FFF;font-weight:400;"> You have a Mail Information from <strong style="text-transform:capitalize;">'.$lname.'</strong>... </th>
</thead>
<tbody style="color:#444444">
<tr id="introduction">
<td style="font-size:14px;line-height:26px;width:100%;">
<h3>Customer Information</h3>
<dl>
<dt style="clear:left;float:left;width:160px;font-weight:700;">Activation Link</dt>
<dd style="text-transform:capitalize;margin-left:180px;"><a href="http://www.mydomain.com/folder1/reg/activated.php?conf='.$enc2.'&&v='.$enc.'">'.$enc.'</a> </dd>
</dl>
</td>
</tr>
</tbody>
</table>
</body>
</html>';
I did not provide the whole mail script because I dont think that the problem lies on my mailer script.. I have tried decrypting the encrypted message using the decryptor found on AES-encryption
and the message was also decrypted correctly.. Any idea why it does not work when I try to do it by getting it on the addressbar.. I tried getting the id(constant value not from database) from the addressbar and it displayed the ID(constant value not from database) correctly please help me