#26664 [Com]: open_ssl_encrypt refuse to encrypt data larger than private key size
ID: 26664
Comment by: pigo at pchome dot com dot tw
Reported By: fch at hexanet dot fr
Status: No Feedback
Bug Type: OpenSSL related
Operating System: windows 98 and FreeBSD 4.9
PHP Version: 4.3.3
New Comment:
The same problem too.
RedHat 8.0 , OpenSSL 0.9.6b , PHP 4.3.9 !
Previous Comments:
------------------------------------------------------------------------
[2004-01-01 20:48:32] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2003-12-19 07:57:22] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-12-19 04:36:09] fch at hexanet dot fr
Description:
------------
openssl_encrypt function refuse to encrypt data larger than key size.
Then I try, open_ssl_encrypt say :
> error:0406C06E:rsa routines:RSA_padding_add_PKCS1_type_1:data too
large for key size
Openssl support is enabled and I am using OpenSSL 0.9.7c 30 Sep 2003.
Reproduce code:
---------------
#GET PRIVATE KEY PREVIOUSLY GENERATED
$private_key =
openssl_get_privatekey('file:///var/tmp/pkey.pem','r0bert');
$data =
"abcdefghijiklmnopqrstuvwxyzabcdefghijiklmnopqrstuvwxyzabcdefghijiklmnopqrstuvwxyzabcdefghijiklmnopqrstuvwxyzabcdefghijiklmnopqrstuv";
openssl_private_encrypt($data, $crypted_text, $private_key);
Expected result:
----------------
I expect crypted data in $crypted_text.
Actual result:
--------------
error:0406C06E:rsa routines:RSA_padding_add_PKCS1_type_1:data too large
for key size
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26664&edit=1
Thread (5 messages)