The key words in this document are to be interpreted as described in BCP 14 [RFC 2119] [RFC 8174] when, and only when, they appear in all capitals.
1. Goal
Change algorithms and keys across stored data without downtime, without downgrade, and with a verifiable record of what changed. Agility is useless if old algorithms can never be turned off, and dangerous if an attacker can make a system fall back to them.
2. Inputs that trigger migration
- a suite moves to
deprecatedorforbidden(CCSAX-0004 §3); - a key is rotated (old version
decrypt-only) or suspected compromised (CCSAX-0005 §5); - an invocation budget approaches its limit (CCSAX-0003 §6.3);
- a tenant is deleted (crypto-shredding, CCSAX-0005 §6).
3. Policy enforcement (implemented)
Every open reports needsMigration = true when the data suite or wrap suite is deprecated or the
key used is decrypt-only. Seal and wrap refuse deprecated, forbidden and (by default)
experimental suites, and refuse decrypt-only keys. Opening a forbidden suite fails.
4. Downgrade resistance (implemented)
- Policy is never taken from data. The envelope names its suite; whether that suite is allowed comes only from the trusted registry.
- Key–suite binding. Each key is bound to one suite. An envelope that names a different suite than the key's binding is rejected, so an attacker cannot reinterpret a key under a weaker suite.
- No fallback. If the preferred suite fails, implementations MUST NOT retry with another suite.
- Commitment and AAD bind the suite. The data suite is in the authenticated header; the wrap suite is in the authenticated wrap header and in the wrap-key HKDF salt.
- Public-key wrap caveat. Anyone with a recipient public key can create envelopes. Downgrade protection for H1 therefore relies on (1)–(3): a forged envelope under a forbidden suite is rejected by policy before any key is used.
Formal modelling of these properties (and of migration correctness) is Labs L3.
5. Migration engine (0.2)
States of a migration job: planned → running → verifying → done, or failed / paused (resumable).
Inventory. Enumerate envelopes (via the adopter's storage adapter) and read unauthenticated metadata with
inspect()(suite, mode, kid, kv, wrap alg). Inventory is advisory; every actual operation authenticates.Plan. Group by (suite, wrap alg, kid, kv) and choose an action per group:
Situation Action wrapped, KEK rotated or wrap suite deprecated rewrap (CCSAX-0003 §7.4) — ciphertext untouched direct mode under a rotated key re-encrypt data suite deprecated re-encrypt under an active suite key suspected compromised re-encrypt (rewrap is not enough if DEKs may be exposed) Execute in idempotent batches. For each item: open (or unwrap) with the old key, produce the new envelope, write it with compare-and-swap on the old value, so concurrent application writes are never overwritten. A crash leaves each item either old or new, both readable.
Verify. Re-open every new envelope with only the new keys before marking the batch done.
Log. Record
migrate.start, per-batchmigrate.batch(counts and a hash of the item ids, no plaintext and no personal data) andmigrate.donein the CVL (CCSAX-0007).Retire. When inventory shows zero items under an old key or suite, mark the key destroyed or move the suite towards
forbiddenvia CEP.
The engine MUST be resumable from its last committed batch and MUST be safe to run twice.
6. Verification and audit
An auditor SHOULD be able to check from the CVL alone: which suites/keys were retired and when, that migrations started and finished, and the item counts. What a third party can and cannot conclude from the log is Labs L4.
7. Security considerations
- Migration temporarily needs both old and new keys; minimise that window.
- Inventory metadata is unauthenticated; never use it for access decisions.
- Rewrap after a suspected DEK exposure is insufficient; re-encrypt.
- A
forbiddensuite blocks opening by design; recovering such data requires an explicit, logged, out-of-band policy override, never a library default.
8. References
[RFC 2119], [RFC 8174]; RFC 7696 (R. Housley, "Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms", BCP 201, November 2015); NIST CSWP 39 on crypto agility (cited in Labs L3); K. Bhargavan et al., "Downgrade Resilience in Key-Exchange Protocols", IEEE S&P 2016 (cited in Labs L3); CCSAX-0003, -0004, -0005, -0007.