#37595 [Opn]: last part of the string is lost at decoding
| From: | coditza at cluj dot astral dot ro | Date: | Mon, 29 May 2006 13:07:08 +0000 |
| Subject: | #37595 [Opn]: last part of the string is lost at decoding | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97747@lists.php.net to get a copy of this message | ||
ID: 37595
User updated by: coditza at cluj dot astral dot ro
Reported By: coditza at cluj dot astral dot ro
Status: Open
Bug Type: mcrypt related
Operating System: windows
PHP Version: 4.4.2
New Comment:
The example is for freebsd 6.0 actually, but the beavior is the same
both on windows (with php4) and on freebsd (with php5)
Previous Comments:
------------------------------------------------------------------------
[2006-05-25 23:49:00] coditza at cluj dot astral dot ro
Description:
------------
If the lenght of the encoded string is a multiple of chipher block
size, the last blocksize part of the chipher is lost at decoding.
Reproduce code:
---------------
Use the script at: http://www.coada.net/develop/crypt.phps to
produce
an encoded file, then, from shell:
openssl bf-cbc -in out.dat -out out.dec -K
000102030405060708090a0b0c0d0e0f -iv 0102030405060708 -d
and
cat out.dec
Expected result:
----------------
coditza@keep$
12345678qwertyui12345678coditza@keep$
Actual result:
--------------
bad decrypt
31976:error:06065064:digital envelope routines:EVP_DecryptFinal:bad
decrypt:/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/evp/evp_enc.c:450:
coditza@keep$ cat out.dec
12345678qwertyuicoditza@keep$
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37595&edit=1