Re: [Cbor] CBOR magic number, file format and tags

Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Thu, 21 January 2021 01:07 UTC

Return-Path: <jeffpc@josefsipek.net>
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 628F73A0DBC; Wed, 20 Jan 2021 17:07:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=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 RdHCLkLIA5-w; Wed, 20 Jan 2021 17:07:51 -0800 (PST)
Received: from smtp.jeffnet.31bits.net (josefsipek.net [71.174.113.7]) by ietfa.amsl.com (Postfix) with ESMTP id D5CD23A0C1C; Wed, 20 Jan 2021 17:07:49 -0800 (PST)
Received: from meili.valhalla.31bits.net (unknown [172.27.0.102]) by smtp.jeffnet.31bits.net (Postfix) with ESMTPSA id DC19330502; Thu, 21 Jan 2021 01:07:48 +0000 (UTC)
Date: Wed, 20 Jan 2021 20:07:42 -0500
From: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
To: Michael Richardson <mcr+ietf@sandelman.ca>
Cc: cbor@ietf.org, cose <cose@ietf.org>
Message-ID: <YAjT3j4cwvnLR4AA@meili.valhalla.31bits.net>
References: <3C77CB5D-6AEA-4D70-96A2-3826DB8DAB18@island-resort.com> <10306.1611186961@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <10306.1611186961@localhost>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/qSzkeB1zYrdV_SqiwlDh09_XJoA>
Subject: Re: [Cbor] CBOR magic number, file format and tags
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: Thu, 21 Jan 2021 01:07:54 -0000

On Wed, Jan 20, 2021 at 18:56:01 -0500, Michael Richardson wrote:
...
> Since very early in computing, operating systems have sought ways to mark
> which files could be proposed by which programs.
> 
> For instance, the Unix file(1) command, which has existed since 1973
> ({{file}}), has been able to identify many file formats for decades.
> 
...
> # Proposal One
> 
> This proposal uses a CBOR Array of size two.
...
> # Proposal Two
> 
> This proposal uses a CBOR Sequence {{!RFC8742}}.

Recently, I was thinking about the fun fact that the Unicode string "bor"
and the byte string "BOR" end up getting encoded as "cbor" and "CBOR",
respectively.

Maybe that could be somehow (ab)used?  In general, I'm a big fan of
human-readable magic numbers.

Jeff.