|
Posted by laredotornado@zipmail.com on 10/01/07 21:29
Hi,
I'm using PHP 4.4.4. An odd thing is happening with the
mcrypt_encrypt function. I am trying to encrypt a string of data (for
password storage):
$enc = mcrypt_encrypt(MCRYPT_XTEA, ENCRYPTION_KEY, $p_str,
MCRYPT_MODE_ECB, $iv);
and then I'm trying to log in later by encrypting the entered password
and comparing it to the saved password. However, despite the fact
that for each call, the inputs are the same,
MCRYPT_XTEA = "xtea";
ENCRYPTION_KEY = "sdlk2kcow8doq92k";
$p_str = "demo";
MCRYPT_MODE_ECB = "ecb";
$iv = "jX%ukØ=";
on one call I get the encrypted string, "ë;jéøÕG·" and on the other
call, I get "ø34Avýä". What gives?
Thanks, - Dave
[Back to original message]
|