← Return to field notes
craft / security field note

Cryptography begins with the threat model

Before choosing a primitive, put the adversary, asset, channel, and exact cost of failure on the table.

field-note maintained created 2026-06-23 updated 2026-07-18 6 min 3 sections 0 figures
subscribe via RSS report a correction sec intro ~6 min left read 0%
opening contract field-note · maintained
problem
Choosing a cryptographic primitive before defining the adversary and failure cost produces false assurance.
scope
A defensive threat-model-first checklist for communication systems and constrained devices; not a new cryptographic construction.
environment
Embedded and networked systems where standard secure transports may be constrained or unavailable.

Assumptions

  • Established, reviewed primitives are available.
  • Key lifecycle and nonce state can be represented explicitly.

Limitations

  • This note is not a protocol specification, compliance guide, or substitute for independent security review.
Table of contents 3 sections
  1. 1 Start with the communication problem
  2. 2 Add only the guarantees the system needs
  3. 3 Prefer reviewable discipline over cleverness

Start with the communication problem

Cryptography becomes useful when it is tied to a communication problem: who can read, who can alter, who can impersonate, what can be replayed, and what failure actually costs.

The threat model names assets, principals, trust boundaries, physical access, network position, update authority, and recovery cost. A nearby passive listener is different from a compromised gateway; stolen flash is different from a malicious firmware signer. The primitive follows those capabilities. Without that ordering, “encrypted” can hide unauthenticated messages, replayable commands, weak key storage, or a recovery path that bypasses the entire design.

Add only the guarantees the system needs

Start with the insecure channel and add only the guarantees the system needs. On constrained devices, discipline matters more because there is no convenient TLS-shaped escape hatch.

Authenticated encryption protects confidentiality and integrity only when nonces never repeat under a key and the associated data binds the right protocol context. Sequence numbers and replay windows need durable reset semantics. Key rotation needs overlap and revocation rules. Device identity needs a provisioning root and an incident path. Every guarantee creates state, and every piece of state needs power-loss, rollback, and manufacturing behavior.

Prefer reviewable discipline over cleverness

The standard is not cleverness. Use established primitives, keep nonces honest, rotate keys deliberately, expose the threat model, and let an audit attack the assumptions before production does.

The implementation proof includes known-answer vectors, malformed-input tests, downgrade resistance, constant-time review where secrets influence control flow, fuzzing at parser boundaries, and explicit zeroization limits. It also includes operational questions: who can rotate a key, what telemetry reveals authentication failures without leaking secrets, and how a fleet recovers after compromise. Security is the complete lifecycle, not the successful decrypt call.

evidence ledger 1 claim
  1. sourced
    NIST lightweight cryptography guidance

    Public standards work grounds constrained-device cryptography in explicit security properties and implementation environments.

    inspect source ↗
linked artifacts 1 attached
  • reference
    NIST Lightweight Cryptography

    Public reference for constrained-environment cryptographic standards and evaluation.

    open ↗