RFC-0021: Quorum (k-of-n) Recipients

  • Status: Proposed; adds a core recipient type next to RFC-0012.

  • Owner: Format and security leads.

  • Last updated: 2026-11-29

Context

An escrow recipient (RFC-0011) that one person can use is a single point of compromise: whoever holds the recovery key can read everything. Key management standards require “split knowledge and dual control” for exactly this kind of key (for example PCI DSS v4.0 requirement 3.7.6 for manual cleartext key operations), and enterprises run recovery as a ceremony that needs several custodians.

Binding decision

cryptography_suite.providers.quorum.QuorumRecipientProvider is a core KeyProvider:

  • Shares. The data key is split with Shamir secret sharing over GF(2^8) (AES polynomial x^8 + x^4 + x^3 + x + 1), one independent random polynomial of degree threshold - 1 per byte, with coefficients from the operating-system CSPRNG. Share i (1-based) is the polynomial at x = i. Any threshold shares reconstruct the key by Lagrange interpolation at zero; fewer reveal nothing about it. 2 <= threshold <= n <= 16.

  • Custodians. Each share is wrapped with HPKE (RFC-0012) to one custodian’s public key, any classical or post-quantum hybrid KEM (RFC-0017), and custodians may mix KEMs. Custodians must be distinct keys.

  • Versions. A quorum version is q<threshold>of<n>- followed by the hex SHA-256 of "cryptography-suite/v4 quorum key" || 0x00 || u8(threshold) || u8(n) || each custodian fingerprint (RFC-0012) as u16(len) || fingerprint, in share order. Changing the threshold or the custodian set is a new version under the same key_id; the newest is what an unversioned KeyRef names, and rewrap moves envelopes to it.

  • Binding. Share i’s HPKE binding is "cryptography-suite/v4 quorum share" || 0x00 || the length-prefixed (u32) provider id, key id, quorum version, u8(i), and SHA-256(envelope protected bytes). A share cannot be moved to another envelope, quorum version, or share position.

  • Wrapped key. body || tag, where body is u8(1) || u8(threshold) || u8(n) followed, for each share in order, by u16(len) || HPKE ciphertext, and tag is HMAC-SHA-256(HMAC-SHA-256(dek, "cryptography-suite/v4 quorum integrity" || 0x00), SHA-256(binding) || body). The wrapping algorithm identifier is cs4-quorum-shamir-gf256-hpke. Any structural mismatch or tag mismatch is AUTHENTICATION_FAILED.

  • Recovery. add_custodian_identity(private_key) makes one custodian’s key available. Unwrap needs at least threshold of the quorum’s custodians and otherwise fails with CAPABILITY_UNSUPPORTED; it decrypts exactly threshold shares, so only those custodians’ shares are exposed in memory, and wipes the shares and the reconstruction buffer. It then checks the tag with the reconstructed key, which authenticates every byte of the wrapped key, including shares it did not read, and detects a wrong reconstruction. (An earlier draft relied on the envelope’s recipient-manifest MAC for unread shares; running the provider conformance kit against a different custodian layout showed that a provider must reject such a change on its own.)

Security consequences

  • No single custodian, and no group smaller than the threshold, can recover the data key from the quorum recipient.

  • With add_custodian_identity, the custodians’ private keys meet in the recovering process. RFC-0025 adds a distributed ceremony in which each custodian decrypts only their own share and re-encrypts it to the coordinator, with no format change.

  • GF(2^8) arithmetic uses table lookups over secret values; it runs when sealing and during recovery and is not intended for environments where an attacker can time those operations at fine grain.

Test and validation requirements

tests/integration/test_quorum_recipients.py covers a KMS primary with a 2-of-3 quorum escrow end to end, every subset of a 3-of-5 quorum (all threshold subsets recover, no smaller subset does), the conformance kit, binding to header, version, and position, every structural rejection, a change to every byte of the wrapped key, tampering seen through Protector.open, rotation and rewrap, refusals, validation, and Shamir properties under Hypothesis.