Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67447 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7110 invoked from network); 18 May 2013 09:49:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 May 2013 09:49:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.43 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.43 mail-oa0-f43.google.com Received: from [209.85.219.43] ([209.85.219.43:41757] helo=mail-oa0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/31-31589-D8E47915 for ; Sat, 18 May 2013 05:49:02 -0400 Received: by mail-oa0-f43.google.com with SMTP id o6so6065410oag.30 for ; Sat, 18 May 2013 02:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=x8eoqDw4lNASPPx/Wn2djUR8ZENbYZlH72vPlHMCgQU=; b=U792rJfQUv+S1DXLG60brhkffB8FBLDwhGPG5zE1V9T19eV+Yi0J1EIXtzn7vSnycb XN/nsPHoFlBTtYRfvBXaDw1xc4lxkkBlKPvX5Aayo/NZT3A+mHp8jxcoTa+7/T4t84XT kZDiZzpMxoP0ocDWVWemw3VqTTTy36th2pzyaV7GHn6ddPUvCJuPGlZ51fSZb837yaBi Zfy1Xu1cAIxgKHXeO2u5SKr3tvUSoTFI9t1untRXGmemxJ82z5GwP60BnMmP92K6mR0e I5nBIdMnk9X90Kuop3tWjqjGWNPdh40fs/WJo3eoILA3dZg2Piib6J3Kz4xMF3UMXXcZ G87w== MIME-Version: 1.0 X-Received: by 10.60.116.138 with SMTP id jw10mr15133298oeb.64.1368870538695; Sat, 18 May 2013 02:48:58 -0700 (PDT) Received: by 10.182.49.136 with HTTP; Sat, 18 May 2013 02:48:58 -0700 (PDT) Date: Sat, 18 May 2013 11:48:58 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=089e0115ec1c33d9c004dcfb02de Subject: hash_pbkdf2 vs openssl_pbkdf2 From: nikita.ppv@gmail.com (Nikita Popov) --089e0115ec1c33d9c004dcfb02de Content-Type: text/plain; charset=ISO-8859-1 Hi internals! I just noticed that we added the PBKDF2 algorithm two times in PHP 5.5. Once in the hash extension, once in the OpenSSL extension. The hash_pbkdf2 function was added via this RFC: https://wiki.php.net/rfc/hash_pbkdf2 The openssl_pbkdf2 function probably was not noticed at that time because it was just commited, but not mentioned anywhere else (NEWS, UPGRADING, etc). Only saw it in vrana's documentation updates just now. The relevant commit is here: https://github.com/php/php-src/commit/f4847ef It would be nice if we could have only one of those functions. I'm currently tending towards the hash_ variant because of the commit message of the openssl_ function: > No easy way to put these in the hash extension since we don't really support optional > parameters to certain algorithms. Implemented in openssl for now since it has it already > and is pretty stable. > > Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be > changed in the future. It seems that the author already would have preferred it in the hash extension and that the openssl variant only works with sha1 (or was only tested with it? not sure). Nikita --089e0115ec1c33d9c004dcfb02de--