Re: [Mathmesh] UDF Design notes

Michael Richardson <mcr+ietf@sandelman.ca> Wed, 14 August 2019 23:45 UTC

Return-Path: <mcr+ietf@sandelman.ca>
X-Original-To: mathmesh@ietfa.amsl.com
Delivered-To: mathmesh@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1E36E120901 for <mathmesh@ietfa.amsl.com>; Wed, 14 Aug 2019 16:45:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i37uz7bXDCQm for <mathmesh@ietfa.amsl.com>; Wed, 14 Aug 2019 16:45:15 -0700 (PDT)
Received: from tuna.sandelman.ca (tuna.sandelman.ca [209.87.249.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 26E5D1208E6 for <mathmesh@ietf.org>; Wed, 14 Aug 2019 16:45:14 -0700 (PDT)
Received: from sandelman.ca (obiwan.sandelman.ca [IPv6:2607:f0b0:f:2::247]) by tuna.sandelman.ca (Postfix) with ESMTP id E57073818C for <mathmesh@ietf.org>; Wed, 14 Aug 2019 19:44:24 -0400 (EDT)
Received: from localhost (localhost [IPv6:::1]) by sandelman.ca (Postfix) with ESMTP id 05FEFA8A for <mathmesh@ietf.org>; Wed, 14 Aug 2019 19:45:13 -0400 (EDT)
From: Michael Richardson <mcr+ietf@sandelman.ca>
To: mathmesh@ietf.org
In-Reply-To: <CAMm+LwgqiUNNqR73uO6=iuK0VUPEBWdVLVp7H=KxiB-O8_y+hQ@mail.gmail.com>
References: <CAMm+LwgqiUNNqR73uO6=iuK0VUPEBWdVLVp7H=KxiB-O8_y+hQ@mail.gmail.com>
X-Mailer: MH-E 8.6; nmh 1.7+dev; GNU Emacs 24.5.1
X-Face: $\n1pF)h^`}$H>Hk{L"x@)JS7<%Az}5RyS@k9X%29-lHB$Ti.V>2bi.~ehC0; <'$9xN5Ub# z!G,p`nR&p7Fz@^UXIn156S8.~^@MJ*mMsD7=QFeq%AL4m<nPbLgmtKK-5dC@#:k
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
Date: Wed, 14 Aug 2019 19:45:13 -0400
Message-ID: <30023.1565826313@localhost>
Archived-At: <https://mailarchive.ietf.org/arch/msg/mathmesh/AmSpxdyMgXLeP-bQkpJuShZkPGQ>
Subject: Re: [Mathmesh] UDF Design notes
X-BeenThere: mathmesh@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <mathmesh.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mathmesh>, <mailto:mathmesh-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mathmesh/>
List-Post: <mailto:mathmesh@ietf.org>
List-Help: <mailto:mathmesh-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mathmesh>, <mailto:mathmesh-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Aug 2019 23:45:17 -0000

Phillip Hallam-Baker <phill@hallambaker.com>; wrote:
    > The original starting point was the need for a 'better PGP fingerprint'. In
    > particular, I wanted a digest representation that was:

    > * Reasonably compact in both printed and voiced form.
    > * Supported use of SHA2
    > * Could be expressed at varying precision as the application needs demanded
    > * Could be upgraded to make use of new algorithms if absolutely necessary
    > * Could be input via a keyboard
    > * Could be compared for equality
    > * Could be used to create a fingerprint of any type of data (not just keys)
    > * Support use in QR codes, DNS labels, etc.

I think that this was a rather ambitious set of requirements :-)

    > The choice of Base32 comes from the observation that fingerprints are
    > frequently read out aloud and having to distinguish case makes the process
    > tedious and error prone. So it cant be Base64 but Base32 gives us five bits
    > per char instead of four.

I agree with your use.
I wonder if we can train people not to need to mention the case as they
compare.  I should look again if you specify upper-case only.

    > The Type Identifiers for SHA-2 and SHA-3 are chosen so as to cause the
    > first letter of a SHA-2 digest to always be an M (for Merkle-Damgard and to
    > remind us of the Rivest/MD5 legacy) and tthe first letter of a SHA-3 digest
    > will always be a K for Keccak.

This was very cute.

    > Erm no, what people have done there is provide a new attack vector because
    > most people will only remember the first ten digits of an address at most
    > and this mnemonic is encouraging people to assume from memory. Anyone who
    > wants to impersonate the above, just needs to search for a public key whose
    > first eight digits match and they will probably trick enough people to be
    > interesting.

    > So I decided to encourage people not to do this and then thought, what if
    > they could have a shorter fingerprint that was just as strong.

Interesting observation.

    > The two use cases that I am most tempted to add are representations for
    > public and private key literals.

    > PRO: One spec fits all.
    > CON: Even 25519 keys are long do we read them out over the phone? Perhaps
    > we should consider Base64?

No, but being able to scan QR codes with public keys is important.
DPP needs/uses this already.

    > The first is to add a Type indicator PKIX (112 = P)  which would be
    > followed by a PKIX KeyInfo block. This would be encoded in Base32. This
    > would look something like this for an Ed25519 key:

On the subject of Subject Key Identifier, which you have created a MIME type,
RFC7469, section 2.4 also gets close to this.

    > PB5S-R4AJ-3FBT-7NHO-T26Z-2E6Y-WFH4-SAQQ-RY7F-Q7UU-URHU-VCDB-HALY-LNCG

    > The second would be to do the above in Base64 but use a type indicator that
    > gives an initial letter in Base64:

I don't think that reading base64 over the phone will ever be a thing.
Validating (visually) that a QR scan worked right will be a thing.
I prefer to keep it all in base32.

--
Michael Richardson <mcr+IETF@sandelman.ca>;, Sandelman Software Works
 -= IPv6 IoT consulting =-