Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9228 invoked from network); 23 Dec 2013 10:20:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Dec 2013 10:20:50 -0000 X-Host-Fingerprint: 80.4.21.210 cpc22-asfd3-2-0-cust209.1-2.cable.virginm.net Received: from [80.4.21.210] ([80.4.21.210:18279] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/85-08405-18E08B25 for ; Mon, 23 Dec 2013 05:20:50 -0500 To: internals@lists.php.net,Stas Malyshev Message-ID: <52B80E7E.5050700@php.net> Date: Mon, 23 Dec 2013 10:20:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 References: <3014595E-B155-47F6-AC7B-71083D89525D@rouvenwessling.de> <52B80C5B.2050208@sugarcrm.com> In-Reply-To: <52B80C5B.2050208@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.4.21.210 Subject: Re: [PHP-DEV] [RFC] Timing attack safe string comparison function From: krakjoe@php.net (Joe Watkins) On 12/23/2013 10:11 AM, Stas Malyshev wrote: > Hi! > >> I'd like to propose this RFC to introduce a time-constant string >> comparison function: https://wiki.php.net/rfc/timing_attack > > I wonder how practical this would be. There are probably many side > channels in PHP related to how PHP manages memory, copies variables, > processes opcodes, etc. so I wonder if providing such function for PHP > API would practically add anything or if you should be doing crypto that > sensitive in PHP anyway? > One of the chaps on SO done a bit of testing, it appears that without usleep in php land you cannot avoid cpu spikes, and so cannot get a reliable vector of attack unless the server side code has been prepared to be attacked. But this is only testing. I see the things you see, however, probably better to do something than nothing I think, this is technically the correct thing to do, and is simple enough, so I say do it ... Cheers Joe