Encrypt then decrypt yields extra dots at end

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I thought this code:

$enc=mcrypt_ecb(MCRYPT_RIJNDAEL_256,"salt123","encrypt_me",MCRYPT_ENCRYPT);
$dec=mcrypt_ecb(MCRYPT_RIJNDAEL_256,"salt123",$enc,MCRYPT_DECRYPT);
echo $dec;

would yield "encrypt_me". The actual result is
"encrypt_me......................" (bunch of extra dots).

Why, and how do I fix it?

Does it have something to do w/ the warning I get:

Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty
IV, which is NOT recommend

I assumed that was a security warning, not a functionality warnings?

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux