Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifications around encoding of data within verification QR codes #1839

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Specify the encoding to be used when generating QR codes for device verification.
14 changes: 10 additions & 4 deletions content/client-server-api/modules/end_to_end_encryption.md
hughns marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -1179,10 +1179,16 @@ The process between Alice and Bob verifying each other would be:

###### QR code format

The QR codes to be displayed and scanned using this format will encode binary
strings in the general form:
The QR codes to be displayed and scanned must be
hughns marked this conversation as resolved.
Show resolved Hide resolved
[ISO/IEC 18004:2015](https://www.iso.org/standard/62021.html) compatible and
hughns marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[sadly yes, the spec for QR codes is copyrighted; this seems to be the best we can do.]

contain a single segment that uses the byte mode encoding.

- the ASCII string `MATRIX`
The error correction level can be chosen by the device displaying the QR code.

The binary segment must be of the following form:
hughns marked this conversation as resolved.
Show resolved Hide resolved

- the string `MATRIX` encoded as one ASCII byte per character (i.e. `0x4D`,
`0x41`, `0x54`, `0x52`, `0x49`, `0x58`)
- one byte indicating the QR code version (must be `0x02`)
- one byte indicating the QR code verification mode. Should be one of the
following values:
Expand Down Expand Up @@ -1210,7 +1216,7 @@ strings in the general form:
secret, and it is not a fixed size, clients will just use the remainder of
binary string as the shared secret.

For example, if Alice displays a QR code encoding the following binary string:
For example, if Alice displays a QR code encoding the following binary data:

```
"MATRIX" |ver|mode| len | event ID
Expand Down