[Cbor] Cutting down base64 (b64'....') in diagnostic notation examples, before elision
Carsten Bormann <cabo@tzi.org> Wed, 23 March 2022 06:47 UTC
Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1])
by ietfa.amsl.com (Postfix) with ESMTP id D2BFB3A0DB5
for <cbor@ietfa.amsl.com>; Tue, 22 Mar 2022 23:47:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5
tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
T_SCC_BODY_TEXT_LINE=-0.01] 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 eQVgFt7xakFJ for <cbor@ietfa.amsl.com>;
Tue, 22 Mar 2022 23:47:45 -0700 (PDT)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de
[IPv6:2001:638:708:32::15])
(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ietfa.amsl.com (Postfix) with ESMTPS id D8A203A0D72
for <cbor@ietf.org>; Tue, 22 Mar 2022 23:47:42 -0700 (PDT)
Received: from smtpclient.apple (p5089ad4f.dip0.t-ipconnect.de [80.137.173.79])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4KNf6y3411zDCby;
Wed, 23 Mar 2022 07:47:38 +0100 (CET)
From: Carsten Bormann <cabo@tzi.org>
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\))
Date: Wed, 23 Mar 2022 07:47:37 +0100
Message-Id: <0B4A3773-CC4D-4404-9CF4-E58F34AF3574@tzi.org>
To: cbor@ietf.org
X-Mailer: Apple Mail (2.3696.80.82.1.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/1I-9lSdRckwebBuIXlupHbhkykI>
Subject: [Cbor] Cutting down base64 (b64'....') in diagnostic notation
examples, before elision
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>,
<mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>,
<mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 23 Mar 2022 06:47:49 -0000
(1) Random observation, most relevant until we have elision: If you randomly truncate a base64 string (no padding), there is only a 1 out of 3 chance (actually 21/64) that the result will still be a base64 string (no padding). If you cut it down to a multiple of 4 characters, the result will always be valid. (2) The current implementation of cbor-diag does not allow comments in b64’…' (https://github.com/cabo/cbor-diag/issues/22). However, they already work in h’…’ byte strings, so… h’47110815/.../‘ …or more verbosely… h’47110815/... (rest of CWT omitted)/‘ …leaves your diagnostic notation parsable (but with truncated values, of course). Note that an apostroph terminates the byte string prematurely, so don’t use something like... h’47110815/... (rest of client’s key omitted)/‘ …in your h’…’ comments. Because of the abovementioned bug, I’d use b64’A7ii08iS'/... (rest of CWT omitted)/ …for now if b64 is needed (but see note about truncation above). (Apologies for smartquotes.) Grüße, Carsten
- [Cbor] Cutting down base64 (b64'....') in diagnos… Carsten Bormann
- Re: [Cbor] Cutting down base64 (b64'....') in dia… Michael Richardson
- Re: [Cbor] Cutting down base64 (b64'....') in dia… Carsten Bormann
- Re: [Cbor] Cutting down base64 (b64'....') in dia… Michael Richardson
- Re: [Cbor] Cutting down base64 (b64'....') in dia… Carsten Bormann