|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-25 23:49 UTC] 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$ PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 04:00:02 2025 UTC |
Change for($i=0;$i<$max;$i++) { to for($i=0;$i<=$max;$i++) { Not PHP problem, just a user error.