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?

You could, in theory, write some kind of PHP script that runs forever, and
provides the functionality you need through sockets or shared memory or,
if you already have a database connection on every page anyway, the
database, or...

I don't know that any of those are going to actually be fast enough to
stay under the 1 second mark, much less your goal of 0.001 seconds...

It's also possible that some compile-time settings of mcrypt may or may
not provide you with faster entropy, possibly with 'less' entropy and a
concommitant decrease in the actual security of mcrypt -- And, for all I
know, those super-special hardware devices that can be used with mcrypt
will be super duper fast and that's why they exist:  To solve this
problem.

You may, or may not, be able to find an mcrypt module of Apache, which,
possibly, would initialize the entropy once when each httpd starts up, and
PHP can just glom onto that entropy-ness and not spend 1.0 seconds doing
it.

Or, possibly, you could try to write a custom module in PHP that would
load up the entropy just once.

It's also ENTIRELY possible that doing any of these things will make your
mcrypt completely unsuitable for the purpose it was intended.

You'd need about 10 years of study to figure that out for sure... Good Luck.

-- 
Like Music?
http://l-i-e.com/artists.htm

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

Reply via email to