#31588 [Opn->Bgs]: First execution of OpenSSL encryption/decryption function is very slow

From: Date: Tue, 18 Jan 2005 00:23:06 +0000
Subject: #31588 [Opn->Bgs]: First execution of OpenSSL encryption/decryption function is very slow
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72339@lists.php.net to get a copy of this message
ID: 31588 Updated by: wez@php.net Reported By: bolzen at navigator dot lv -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: Windows 2003 PHP Version: 5.0.3 New Comment: Not a php bug; the openssl libraries are gathering entropy on that first hit. Previous Comments: ------------------------------------------------------------------------ [2005-01-18 00:03:51] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31588&edit=1

« previous php.bugs (#72339) next »