diff --git a/biblio.json b/biblio.json index dc6d95a..f961249 100644 --- a/biblio.json +++ b/biblio.json @@ -1,15 +1,25 @@ { - "QUIC": { - "authors": [ - "J. Iyengar", - "M. Thomson" - ], - "date": "12 September 2019", - "href": "https://tools.ietf.org/html/draft-ietf-quic-transport-23", - "title": "QUIC: A UDP-Based Multiplexed and Secure Transport", - "status": "Internet Draft", - "publisher": "IETF" - } + "QUIC": { + "authors": [ + "J. Iyengar", + "M. Thomson" + ], + "date": "12 September 2019", + "href": "https://tools.ietf.org/html/draft-ietf-quic-transport-23", + "title": "QUIC: A UDP-Based Multiplexed and Secure Transport", + "status": "Internet Draft", + "publisher": "IETF" + }, + "iso18004": { + "href": "https://iso.org/standard/62021.html", + "title": "Information technology — Automatic identification and data capture techniques — QR Code bar code symbology specification", + "status": "Published", + "publisher": "ISO/IEC", + "isoNumber": "ISO 18004:2015", + "rawDate": "2015-02" + } } + + diff --git a/index.bs b/index.bs index c3e94ae..49d40bc 100644 --- a/index.bs +++ b/index.bs @@ -53,6 +53,7 @@ url: https://tools.ietf.org/html/rfc8122#section-5; type: dfn; spec: RFC8122; te url: https://tools.ietf.org/html/rfc8122#section-5; type: dfn; spec: RFC8122; text: md5 url: https://tools.ietf.org/html/rfc6381#section-3; type: dfn; spec: RFC6381; text: codecs parameter url: https://tools.ietf.org/html/rfc8610#section-3; type: dfn; spec: RFC8610; text: concise data definition language +url: https://www.iso.org/standard/62021.html#; type: dfn; spec: iso18004; text: QR code url: https://tools.ietf.org/html/rfc5280#section-4.2.1.3; type: dfn; spec: RFC5280; text: digitalSignature url: https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.3; type: dfn; spec: RFC8446; text: signature scheme @@ -710,6 +711,8 @@ QR-code and a numeric PSK), they should be for the same PSK. If they were different, the PSK presenter would not know which one the user chose to use, and that may lead to authentication failures. +Appendix [[#appendix-c]] describes two encoding schemes for PSKs that agents may support to produce either a string or a [=QR code=] for display to the user. + Authentication with SPAKE2 {#authentication-with-spake2} -------------------------- @@ -740,8 +743,6 @@ This authentication method assumes the agents share a low-entropy secret, such as a number or a short password that could be entered by a user on a phone, a keyboard or a TV remote control. -Issue(210): [Security] Describe encoding/decoding of PSK into numeric and QR codes. - SPAKE2 is not symmetric and has two roles, Alice (A) and Bob (B). The client acts as Alice, the server acts as Bob. @@ -2826,3 +2827,71 @@ https://github.com/tabatkins/bikeshed/issues/1128 + +Appendix C: PSK Encoding Schemes {#appendix-c} +================================ + +The following appendix describes two encoding schemes for PSKs that take a value +`P` between 20 bits and 80 bits in length and produce either a string or a [=QR +code=] for display to the user. + +Agents should use these encoding schemes to maximize the interoperability of the +authentication step, which typically requires displaying the PSK on one +device and the user inputting it on another device. + +Base-10 Numeric {#appendix-c-base-10} +--------------- + +To encode `P` into a numeric string, follow these steps: + +1. Convert `P` to a base-10 integer `N`. +2. If `N` has fewer than 9 digits: + * Zero-pad `N` on the left with `3 - len(N) mod 3` digits. + * Output `N` in groups of three digits separated by dashes. +3. If `N` has more than 9 digits: + * Zero-pad `N` on the left with `4 - len(N) mod 4` digits. + * Output `N` in groups of four digits separated by dashes. + +
+For PSK `61488548833`, the steps would produce the string `0614-8854-8833`. +
+ +To decode a string `N` into a PSK `P`, follow these steps: + +1. Remove dashes and leading zeros from `N`. +2. Parse `N` as a base-10 decimal number to obtain `P`. + +Note: `P` values between approximately 2^30 and 2^40 will produce values between +10 and 12 digits in length. Values over 12 digits are inconvenient to input +and have limited additional security value. + +Note: We do not allow the use of hexadecimal encoding here, because it would +be ambiguous with base-10 numeric encodings, and not all devices may support +alphanumeric input. + +QR Code {#appendix-c-qr-code} +------- + +To encode a PSK into a QR code, follow these steps: + +1. Set `N` to the value of `P` converted to an ASCII-encoded, hexadecimal string. +2. Construct a text [=QR code=] with the value of `N`. + +
+For PSK `61488548833`, the steps would produce the following QR code: +

+ + + + +

+
+ +To decode a PSK `P` given a QR code, follow these steps: + +1. Obtain the string `N` by decoding the QR code. +2. Parse `N` as a hexadecimal number to obtain `P`. + + + +