Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93825 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28390 invoked from network); 5 Jun 2016 21:08:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2016 21:08:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.44 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.218.44 mail-oi0-f44.google.com Received: from [209.85.218.44] ([209.85.218.44:36607] helo=mail-oi0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/33-09778-3D494575 for ; Sun, 05 Jun 2016 17:08:35 -0400 Received: by mail-oi0-f44.google.com with SMTP id p204so4361209oih.3 for ; Sun, 05 Jun 2016 14:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=macu7Tmtj1olt2tfF23iXV2k6d9AX1OH3ZVAhYM4/Bk=; b=Yjw/tYa7hGLcC7+v93phK6Kcvoa5oaFXolRVnHoE3TWlAVqbB1jFHfkkF42wYs31s7 bOLGliF4yKpFRy58BTjLa8+sBHG7XPggfCZgeSqBEFubroFClL3fQtcXQAXOxsd2/fg2 Wtb2KrfGoOAYZ857iL6OHPycb+ceu05s2Zzilnf35H/rrSJNXPnzxGUXXI7oFU3ZzQrX zIxLisi7/JceFnjLe5/1pxFk7PoBiaV5jdZ2C6HNUsXxSRmFPoXnIV+O1y4KD3ZrndZw x0+wbn34gCNNjVRQ62HqTDui23mCF2guRoqrboTyUwA9T3EEe+lrU9WQnoa58LiSiNY2 Fazw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=macu7Tmtj1olt2tfF23iXV2k6d9AX1OH3ZVAhYM4/Bk=; b=QWNTC9zaHSJ6X2P4pw60HUza0FGpNK18Nn7T7hJEKyZG8smz9wRwRsB5+nZCaCx+xy gd3blHJPPHrVuy0KEx9b2NVF/Ohj5palA1i34La7RZAgW7o5f6roPe8l0oJ+Nusu1XZ6 bdIYXJdOtBjR/l4erbomnpqFu8ixRuqr5UO6Hecuatiib+xxE/8xp4MZat5iEgf5lkOg CNyI5ZUjgqlFZ6Q0xYCLe0KolSHTdiIk3g3+pLokrEcPBQ+7b+oyRtOrSU+CN3053/CY lwXPs7WzyUU2rrwH9Rcjmy0hFG8i5Sr1vOATXozEWI3aQu+WGNHeBX0hWxUJDvEAVPCL pCqw== X-Gm-Message-State: ALyK8tKlxKQowky7kSqT/rzzO+rL5CyP87u2ISIguuHCtKZUwnzAP3cIwxaxd0vVlQBZ6w== X-Received: by 10.202.78.10 with SMTP id c10mr5711141oib.57.1465160912512; Sun, 05 Jun 2016 14:08:32 -0700 (PDT) Received: from stas-air.attlocal.net (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id d1sm8926085otb.23.2016.06.05.14.08.31 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Jun 2016 14:08:31 -0700 (PDT) To: Scott Arciszewski References: Cc: PHP internals Message-ID: Date: Sun, 5 Jun 2016 14:08:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Libsodium - Discussion From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > My position on the low level nature of libsodium's APIs is as follows: ​ > That sounds like a call to action for > https://wiki.php.net/rfc/php71-crypto rather than a point of concern for > adopting libsodium.​ I think there's a bit of misunderstanding here. The low-level nature of the API is not a problem per se - it is a problem that it is both very high level (such as giving functions names like "box" and "securebox" which hardly allow to understand what's going on) and very low level (like functions spelling out specific algorithm used - I can't even remember or type their name :). Even that might be not a problem if there was a clear segregation between them - i.e. there would be low level API space, which is "don't try this at home" part, and higher level API space which is "newbies welcome" part. So maybe it is just namespacing/docs problem. But right now the situation is like this: I am not a crypto expert, but I have dealt with crypto for years, I have taken multiple courses on both theoretical and practical cryptography, if I'm definitely not Ph.D. I can say I am at least B.Sc. and somewhere in the middle of M.Sc. curriculum :) I still am not completely sure how the whole thing works. I understand enough to say the overall goal is admirable and the infrastructure for it in there, but it seems to need some finish. Some better namespacing, more friendly/consistent names, more friendly arguments/defaults, this sort of thing. > ​Can you count the foot-bullets in that snippet that you'd need to be a > cryptography engineer to successfully avoid? That would be a nice exercise :) > Demo: https://3v4l.org/nYVPf > > Here's a congruent implementation in libsodium:​ I notice however the recipes in the doc are a bit more verbose... > ​ /** > * Libsodium > */ > > ## ENCRYPTION ## > > $message = 'Prime Numbers Rock!'; > $bob_public_key = "... populate here ..."; Here's one of the unclear parts - where this key comes from? Do we even have key infrastructure covered? Do we plan to? > paragonie/halite-- I wholeheartedly endorse that discussion. But I don't > think we should try to solve that problem with this particular RFC. That is fine, but then we need a more clear scope definition - what are the goal we try to achieve here? If we add it, what would we tell the users we have and why it is awesome? > In closing, I don't disagree that a simple crypto API is a good goal to > have. I just think the ideal you're discussing is: > > A. Out of scope, and > B. Kind of belittling to how much of an improvement libsodium is to what > we already have. I don't think belittling libsodium was ever the intent. It is certainly admirable work towards an important goal. The question is just is it already ready for PHP core or it needs a little more work. -- Stas Malyshev smalyshev@gmail.com