[Cbor] CBOR in QRcodes

Michael Richardson <mcr+ietf@sandelman.ca> Tue, 22 June 2021 16:16 UTC

Return-Path: <mcr+ietf@sandelman.ca>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost []) by ietfa.amsl.com (Postfix) with ESMTP id 30E5D3A0B21 for <cbor@ietfa.amsl.com>; Tue, 22 Jun 2021 09:16:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id 3YXEaeb2rN5N for <cbor@ietfa.amsl.com>; Tue, 22 Jun 2021 09:16:19 -0700 (PDT)
Received: from tuna.sandelman.ca (tuna.sandelman.ca [IPv6:2607:f0b0:f:3:216:3eff:fe7c:d1f3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9E3F13A0B20 for <cbor@ietf.org>; Tue, 22 Jun 2021 09:16:19 -0700 (PDT)
Received: from localhost (localhost []) by tuna.sandelman.ca (Postfix) with ESMTP id 4466238BF2 for <cbor@ietf.org>; Tue, 22 Jun 2021 12:17:55 -0400 (EDT)
Received: from tuna.sandelman.ca ([]) by localhost (localhost []) (amavisd-new, port 10024) with LMTP id JXgEvNr20RmP for <cbor@ietf.org>; Tue, 22 Jun 2021 12:17:52 -0400 (EDT)
Received: from sandelman.ca (obiwan.sandelman.ca [IPv6:2607:f0b0:f:2::247]) by tuna.sandelman.ca (Postfix) with ESMTP id 9378938BE9 for <cbor@ietf.org>; Tue, 22 Jun 2021 12:17:52 -0400 (EDT)
Received: from localhost (localhost [IPv6:::1]) by sandelman.ca (Postfix) with ESMTP id 0B6EB1C6 for <cbor@ietf.org>; Tue, 22 Jun 2021 12:16:16 -0400 (EDT)
From: Michael Richardson <mcr+ietf@sandelman.ca>
To: cbor@ietf.org
X-Attribution: mcr
X-Mailer: MH-E 8.6+git; nmh 1.7+dev; GNU Emacs 26.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-sha512; protocol="application/pgp-signature"
Date: Tue, 22 Jun 2021 12:16:16 -0400
Message-ID: <9704.1624378576@localhost>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/iFxJvuhcZltldAsfcA9mvvsaM7w>
Subject: [Cbor] CBOR in QRcodes
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: Tue, 22 Jun 2021 16:16:24 -0000

I was asked to summarize my experiences with encoding CBOR in QRcodes.
The short is that I really have none.  I have created QRcodes that contain
raw binary CBOR, and I've decoded them on a desktop, but I haven't round
tripped them onto paper and into a smartphone via an app (custom or generic).

In writing https://datatracker.ietf.org/doc/draft-richardson-mud-qrcode/ I
interacted with the Return Logistics Alliance (RLA.org), and I generated
QRcodes and scanned them with their app as as well as generic ones.
Their app has the limitation in that it doesn't skip codes it does not know,
instead it hangs.  Their specification is at: https://rla.org/resource/12n-documentation
It is recapped in my document.  As per 12N and ANSI MH10.8.2 , the encoding
uses ASCII control codes: RS, EoT, FS, GS, US characters in its TLV structure.
The Labels are 4-character strings, like "B001", and MUD was assigned "M180"

Thus my surprise at needing to encode CBOR in BASE-45.
I wouldn't have thought that necessary, that one could go directly to binary.
I imagine that the issue is one of what are the existing scanning equipment
out there, in airports, customs booths, etc. Many of them pretend to be
keyboards, and many of the systems they are connected to expect alphanumeric
inputs into a form field (whether an HTML form, or a 3270 terminal).

%diag2cbor.rb voucher_jada123456789.diag | qrencode -8 -o jada123456789.png
%file jada123456789.png
jada123456789.png: PNG image data, 219 x 219, 1-bit colormap, non-interlaced

I'd paste the results of:
%diag2cbor.rb voucher_jada123456789.diag | qrencode -8 -o - -t ASCII

in, but it's wider than 77 columns, so it would get munged.
It's really quite brilliant that we can do QRcodes into ASCII and ANSI block
characters.  We should have done SMIME signature that way :-)

Michael Richardson <mcr+IETF@sandelman.ca>   . o O ( IPv6 IøT consulting )
           Sandelman Software Works Inc, Ottawa and Worldwide