You are here: Re: Delay at first use of OpenSSL functions « PHP « IT news, forums, messages
Re: Delay at first use of OpenSSL functions

Posted by M. Sokolewicz on 01/18/05 17:24

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@php.net:
> 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация