Skip to content

Implement framed envelope-encrypted representations and key rotation #83

Description

@flyingrobots

Outcome

Implement the authenticated encrypted-representation ADR with bounded framed encryption, multi-recipient envelope keys, exact verification, and representation-only key rotation.

Dependencies

Invariant impact

Keep must return the exact logical bytes named by BlobId only after the complete selected encrypted representation has satisfied its framing, AAD, authentication, layout, and reconstruction laws.

Acceptance criteria

  • Encryption and decryption stream within explicit frame/count/byte bounds.
  • A random DEK is generated per representation and wrapped independently for admitted recipients.
  • Every frame binds canonical AAD and refuses reordering, duplication, omission, truncation, and cross-representation substitution.
  • Recipient add/remove and KEK rotation do not re-encrypt payload frames or move BlobId.
  • Rotation returns a receipt binding old and new representation/key-envelope coordinates without exposing key material.
  • No plaintext is committed to caller output before the relevant authenticated boundary succeeds.
  • Golden, mutation, corruption, property, fuzz, process-death, recovery, and public-contract tests pass.
  • Benchmarks report throughput, peak memory, frame overhead, and key-rotation work.
  • The crypto dependency and every enabled feature receive a written dependency review.

Non-goals

  • External key-store administration.
  • Deterministic encryption or plaintext-equality deduplication.
  • Application naming or access-control policy.
  • Treating key rotation as physical deletion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:formatCanonical durable formats and decodingarea:readReconstruction, streaming, and byte-range readsarea:verificationIntegrity verification and corruption posturekind:benchmarkMeasured performance evidencekind:implementationProduction implementation workkind:testTest infrastructure or failure-mode evidencepriority:P1Must fix before closing out the current milestone

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions