18013-5 / micov

mobile international certificate of vaccination
11 stars 3 forks source link

Don't use Base64URL for the QR Encoding #1

Open vitorpamplona opened 3 years ago

vitorpamplona commented 3 years ago

From Annex B

The mdop structure shall be encoded as a barcode compliant with ISO/IEC 18004. The QR code shall contain a URI with “mdop:” as scheme and the mdop structure encoded using base64url-without- padding, according to RFC 4648, as path.

Base64 forces QRs into a binary mode (8 bits per char). Since Base 64 represents information using only 6 bits out of every byte available in the binary mode (64 options out of 256 options per byte), the spec, as currently written, wastes ~75% of the space available in the QR.

vitorpamplona commented 3 years ago

My recommendations are Base32 (no padding) if the committee is conservative and wants to make sure the encoding is stable and Base45 if the committee is willing to take risks of a relatively new encoding specification.

If Base45 is chosen, the content of the QR will not follow the URI Specification (RFC 3986). If Base32 is chosen, the QR content will follow the URI Specification (RFC 3986), which is a huge benefit since most QR readers already process URIs.

vitorpamplona commented 3 years ago

If Base32 or Base45 are chosen, mdop: should also be written in uppercase (MDOP:) to make sure it fits the Alphanumeric QR code charset.