SafetyNumber
Safety number version 1 of two devices (docs/identity-verification.md).
The fingerprint is SHA-256 over
u32 length | domain (UTF-8, "KSecureMessage-SafetyNumber-v1")
| u32 length | first userId (UTF-8) | u32 length | first deviceId (UTF-8) | first identity key (64)
| u32 length | second userId (UTF-8) | u32 length | second deviceId (UTF-8) | second identity key (64)with big-endian integers. first is the device whose address encoding (u32 length | userId | u32 length | deviceId) is smaller, compared unsigned-lexicographically, so both devices derive the same value no matter who asks. Each identity key stays tied to its own address.
displayString is the human-comparable form: 12 groups of 5 decimal digits. encode is the machine-readable form for a QR code or similar, see SafetyNumberCodec. Neither contains key material.
Properties
60 decimal digits in 12 groups of 5, separated by single spaces. Locale independent.
The 12 groups of 5 digits of displayString.
Functions
Compares with the payload the other device shows. Changes nothing, verifies nothing by itself.
The machine-readable payload, version 1 (SafetyNumberCodec). A fresh array on every call.