From:             isedc at yahoo dot com
Operating system: Windows Vista
PHP version:      5.2.5
PHP Bug Type:     mcrypt related
Bug description:  Mcrypt decrypt output bug in Firefox

Description:
------------
Following an MCRYPT example on php.net, when decrypting a string that is
less than 8 characters, will output in firefox and appended with ? marks to
fill the other characters.

Example: ecrypted string is 4 characters long (abcd), when decrypting the
string and outputting to firefox displays: abcd????

This was tested with Firefox 2.0.13.  This does not appear to affect
Internet Explorer 7.

Reproduce code:
---------------
$key = "d9Qg%R*";
$text = "abcd";
        
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB);    
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);  
$enc = mcrypt_encrypt(MCRYPT_XTEA, $key, $text, MCRYPT_MODE_ECB, $iv);
        
$crypttext = mcrypt_decrypt(MCRYPT_XTEA, $key, $enc, MCRYPT_MODE_ECB,
$iv);
echo $crypttext;

Expected result:
----------------
echo output should be: abcd

Actual result:
--------------
echo output is actually: abcd????

-- 
Edit bug report at http://bugs.php.net/?id=44714&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44714&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44714&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44714&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44714&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44714&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44714&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44714&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44714&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44714&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44714&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44714&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44714&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44714&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44714&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44714&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44714&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44714&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44714&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44714&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44714&r=mysqlcfg

Reply via email to