php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31588 First execution of OpenSSL encryption/decryption function is very slow
Submitted: 2005-01-18 00:03 UTC Modified: 2005-01-18 01:23 UTC
From: bolzen at navigator dot lv Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 5.0.3 OS: Windows 2003
Private report: No CVE-ID: None
 [2005-01-18 00:03 UTC] bolzen at navigator dot lv
Description:
------------
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.

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 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-18 01:23 UTC] wez@php.net
Not a php bug; the openssl libraries are gathering entropy on that first hit.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 19 14:01:28 2020 UTC