I have this code:
$original = 'zner5';
$new = mcrypt_decrypt( MCRYPT_3DES, 'keyCodeEncryption', 'C¹`Û‡”fa', 'ecb');
if( $original == $new)
{
echo "$original == $new";
}
else
{
echo "$original != $new";
}
It outputs ‘zner5 != zner5’. Why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I seem to remember hitting this issue myself some time ago, and if I recall correctly, mcrypt_decrypt() might give you a binary string with extra zero bytes on the end, so try this: