I am using this code to decrypt the information sent by GET on the other hand:
$key ="key";
$ema =$_GET['email'];
$iv =$_GET['iv'];
$ema =substr($ema,1,-1);
$iv =substr($iv,1,-1);
$ema =rawurldecode($ema);
$cipher_alg = MCRYPT_RIJNDAEL_128;
$decrypted_string = mcrypt_decrypt($cipher_alg, $key, $ema, MCRYPT_MODE_CBC, $iv);
echo $decrypted_string;
For example, this outputs hello@xyz.com
. However when i compare this string with if statement:
if($decrypted_string=="hello@xyz.com")
echo "Match";
else
echo "No match";
This outputs a strange answer No match
. I am unable to get why is it happening.
This is the result of var_dump($decrypted_string):
string(32) "priyam@itbhu.ac.in"