liveBook · Manning

Trust on first use

As explained in Real-World Cryptography

Trust on first use is a trust model that accepts a key on its first observation and rejects subsequent changes unless explicitly overridden.

Trust on first use (TOFU) accepts a key during the first connection, then treats later changes as suspicious unless someone explicitly overrides the warning. The first exchange may be vulnerable to an active man-in-the-middle attacker, but later verification can expose impersonation. section 10.4 section 10.4.1

A TOFU interaction typically follows these steps:

  • Accept or record the public key shown during the initial connection. section 10.4.1
  • Reject or flag a subsequent connection when its public key differs. section 10.4.1
  • Compare fingerprints or safety numbers through a separate channel, such as a QR-code exchange. section 10.4.1

SSH and Signal

An SSH client can trust a server’s public key on the first connection and block later connections when that key changes. Signal lets users compare safety numbers, more easily through QR codes, to verify the connection after initial trust. section 10.4.1

Figure 10.7 Trust on first use (TOFU) allows Alice to trust her first connection but not subsequent connections if they don’t exhibit the same public key. TOFU is an easy mechanism to build trust when the chances that the first connection is actively MITM’d are low. The association between a public key and the identity (here Bob) can also be verified after the fact in a different channel.

The diagram contrasts the trusted first connection with rejected later keys and shows how identity can be checked afterward through another channel. section 10.4.1

How Real-World Cryptography covers it

How deep it goes
Explains first-use acceptance, changed-key rejection, fingerprint checking, and MITM limitations without detailing implementation internals.
Examples
Uses SSH server keys, Signal safety numbers, QR codes, and out-of-band fingerprint comparisons as concrete examples.
What it assumes
Assumes public keys and secure connections, while introducing key fingerprints, first-use trust, and active MITM threats.
What you can do after
Evaluate whether a changed key indicates impersonation by checking fingerprints through a channel independent of the connection.
How it connects
Connects public-key fingerprints, man-in-the-middle attacks, SSH, Signal, PGP, and web of trust models.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.