Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12023 invoked from network); 4 Feb 2017 17:50:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2017 17:50:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 74.125.82.181 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 74.125.82.181 mail-ot0-f181.google.com Received: from [74.125.82.181] ([74.125.82.181:34143] helo=mail-ot0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/C6-38491-66416985 for ; Sat, 04 Feb 2017 12:50:30 -0500 Received: by mail-ot0-f181.google.com with SMTP id f9so36390291otd.1 for ; Sat, 04 Feb 2017 09:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IXhOGrC82SQJ+a9eE+m6vgLfZFDelvLOKrFMeMZPmtY=; b=JxNiZwOhd5Xq+6Nk1IRUDzyInAclg1yDB9THYkjHSSyF7Ei3Pi3/Q822EKRpkXy/Sn 3AzDgE15WtJ5oNUzCkSJ2QzcmhmpdHM7mJ8kWvYj0bW+jSES0SX+za29VL/+kL2JJgSB MTBMU20mUDjd5gX51B4vWrVwGMCSe9b/fqAIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IXhOGrC82SQJ+a9eE+m6vgLfZFDelvLOKrFMeMZPmtY=; b=FcuvcqHCuIlKgqJNs5V4b1KGVlImwe+ay3Plwx7X+6yH2jyjbDKFOi+28zT3R6ytwC R7/g0k0+binJX0+CqDgizIryHdsabDDgaXxuaOGHOpIx7LYGKs7lMTn2GYH/FhSAbd8D bNwaLsG5oRMzXcxYfDm7uxIJtzlLxZjQTM6emZ15glYyJ57PFJTDfk4ko5Aj2mLrfDUK VgSSPvGQeV1HAhMQxGNG7fy9FLItoHLf8L2hHJ+LElNbKc9BYXhOf3L1Yqb0qDn06MlB zV7jFKSPR5bhTLplyOPmujl2csB1ZGVl7OrqlbIKt5A05c0FerINGlrKQDx3RnNj63rK g/1Q== X-Gm-Message-State: AMke39mQcfdvO7FAJjeROrNC8V02nd0DLO//jsdbuR6f1KQYk9B4upjVcM9/fbd9FhW+dmCq76kj/TjVId+H6Q== X-Received: by 10.157.27.154 with SMTP id z26mr1580888otd.181.1486230627568; Sat, 04 Feb 2017 09:50:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.134.170 with HTTP; Sat, 4 Feb 2017 09:50:26 -0800 (PST) In-Reply-To: References: Date: Sat, 4 Feb 2017 19:50:26 +0200 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113e026c9c641e0547b808dc Subject: Re: [PHP-DEV] [Discussion] HKDF From: narf@devilix.net (Andrey Andreev) --001a113e026c9c641e0547b808dc Content-Type: text/plain; charset=UTF-8 Hi, On Sat, Feb 4, 2017 at 1:01 AM, Yasuo Ohgaki wrote: > Did everyone understand why I propose salt as required parameter and > specify optional salt explicitly? > > I did, and I disagreed. > HKDF w/o salt is OK, but with salt, it's much stronger than w/o it. > In addition, most use case with PHP is something like as follows: > > 1. Get password hash for the user > 2. Generate new key with 1 using HKDF > 3. Use key produced by 2 for encryption/etc > > No it's not. That's the first thing *you* could think of, searching for a problem to solve with it. If you search for it on GitHub, you'll see the most common scenario is to derive a pair of keys for encryption and HMAC. (yes, there are PHP projects using it) Cheers, Andrey. --001a113e026c9c641e0547b808dc--