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.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

60 decimal digits in 12 groups of 5, separated by single spaces. Locale independent.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The 12 groups of 5 digits of displayString.

Link copied to clipboard

Functions

Link copied to clipboard

Compares with the payload the other device shows. Changes nothing, verifies nothing by itself.

Link copied to clipboard

The machine-readable payload, version 1 (SafetyNumberCodec). A fresh array on every call.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String