#26664 [NoF->Bgs]: open_ssl_encrypt refuse to encrypt data larger than private key size
| From: | wez@php.net | Date: | Thu, 11 Nov 2004 07:22:56 +0000 |
| Subject: | #26664 [NoF->Bgs]: open_ssl_encrypt refuse to encrypt data larger than private key size | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68944@lists.php.net to get a copy of this message | ||
ID: 26664
Updated by: wez@php.net
Reported By: fch at hexanet dot fr
-Status: No Feedback
+Status: Bogus
Bug Type: OpenSSL related
Operating System: windows 98 and FreeBSD 4.9
PHP Version: 4.3.3
New Comment:
That's the way that RSA works; you need to create a bigger key to be
able to encrypt bigger chunks of data; the error message is quite
clear.
Not a PHP bug.
Previous Comments:
------------------------------------------------------------------------
[2004-11-11 06:53:30] pigo at pchome dot com dot tw
The same problem too.
RedHat 8.0 , OpenSSL 0.9.6b , PHP 4.3.9 !
------------------------------------------------------------------------
[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