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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bolzen at navigator dot lv
New email:
PHP Version: OS:

 

 [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 Apr 08 16:01:25 2020 UTC