Reply to mcrypt_encrypt giving different results for same input?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация