Re: Delay at first use of OpenSSL functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



well, since it's the openSSL library that's gathering it, that means ou can't control it with PHP itself. If you want to somehow change that process, either modify the library, or (if it's changable via the PHP extension,) modify the PHP extension for openSSL. Point is, there isn't (AFAIK/AFAICS) no way to do it VIA php.


Vladas Shukevichus wrote:
I understand it. That's why I am asking how to make my scripts run not 1 second (totally unacceptable), but 0.001 second. May be it's possible to make it work faster? May be it can gather entropy only once (not every time script executes).
In the same script OpenSSL gather entropy only at first function call,
then it can execute other functions very fast, so why can't it perform this process once not per script execution, but per hours, or let's say once per PHP libraries load in memory? If it can use the same entrophy for many functions, why it need to gather it every time when script run?
18.01.2005 17:24:28
"M. Sokolewicz" <tularis@xxxxxxx> wrote in message
<20050118152406.66615.qmail@xxxxxxxxxxxxx>


didn't you read what wez said? they're gathering entropy... you

*can't*


(and shouldn't want to) prevent that.


Vladas Shukevichus wrote:

Hello, Gents,
When I use any OpenSSL encryption/decryption function (like
openssl_seal, openssl_open, openssl_public_encrypt,
openssl_private_decrypt, etc.) it takes very long time to execute,



when
it has been called in a first time. After that other function

calls

performs very fast in the same script.
[18 Jan 1:23am CET] wez@xxxxxxx:
Not a php bug; the openssl libraries are gathering entropy on

that


first
hit.
How can I prevent this? All scripts executes a second longer, if there are any OpenSSL function.
Reproduce code:
---------------
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, array(openssl_get_publickey('file://C:\512.pub')));
echo 'Time: '.(microtime(true) - $btime);
$btime = microtime(true);
openssl_seal('Some information', $sealed, $ekeys, array(openssl_get_publickey('file://C:\1024.pub')));
echo '<br>Time: '.(microtime(true) - $btime);
Expected result:
----------------
Time: 0.00************
Time: 0.00075888633728
Actual result:
--------------
Time: 0.969028949738
Time: 0.00075888633728

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux