Choose a provider and a backend
A build makes two choices that do not constrain each other: the KMS that holds the KEK, and the crypto backend that runs the AEAD algorithms. Both are Cargo features, see Cargo features.
KMS providers
The KMS decides who else reads the values, what a rotation takes and how a scope is crypto-shredded:
| Google Cloud KMS | AWS KMS | Azure Key Vault | Vault Transit | Local KMS | |
|---|---|---|---|---|---|
| Tink reads envelope values | yes | yes | no | no | no |
| Tink reads keyring keysets | yes | yes, with a key named by its ARN | no | Tink for Go only | no |
| BigQuery reads | yes | no | no | no | no |
| KMS random generator | yes, at the HSM protection level | yes | no | no | no |
| KEK version on each encrypted DEK | yes | no, None | yes | yes | yes |
| Disabling an old KEK version | yes, eventually consistent | no, for key material AWS KMS generated | yes | yes, with min_decryption_version | yes, by dropping it from the list |
| Crypto-shredding a scope | destroying its KEK versions | deleting the key | deleting the key, with all its versions | deleting its key versions | destroying every copy of the KEK |
Notes on the table:
- Tink reads envelope values with
KmsEnvelopeAeadand its own KMS client, see Tink’s KMS envelope, and keyring keysets withKeysetHandle.read, see Exporting a keyset to Tink; - BigQuery’s
KEYS.KEYSET_CHAINdecrypts with Cloud KMS only, see Decrypt columns in BigQuery SQL or with Tink; - the KEK version decides how a KEK rotation is checked before the old version is disabled, see Rotate keys and re-encrypt values. Each provider page has its rotation, under “Key versions and rotation”: Google Cloud KMS, AWS KMS, Azure Key Vault, Vault Transit and Local KMS;
- with an RSA key on Azure Key Vault the encryption is a public-key operation, so whoever holds the
public key encrypts a DEK of their own into a keyring record. Use an AES key from Managed HSM,
with
algorithmset toAzureKmsAlgorithm::Aes256KeyWrap, see Azure Key Vault and Keyring limits; - the local KMS has no IAM, no audit log and no HSM, see Local KMS;
- crypto-shredding per KMS is in Erase one customer’s data for
good; a keyring under a shared KEK is shredded with
dangerously_shred(), see Shredding a tenant withdangerously_shred().
The TLS root store and the TLS crypto provider are a feature choice for Google Cloud KMS, Azure and Vault Transit, with the rules in Feature rules.
Crypto backends
ring | aws-lc | aws-lc-fips | rustcrypto | |
|---|---|---|---|---|
| AES-256-GCM-SIV | no | yes | yes | yes |
| RSA-OAEP encryption, for a producer under an asymmetric KEK | no | yes | yes | yes |
| FIPS module | no | no | yes | no |
| Needs a C toolchain | yes | yes | yes, with CMake and Go | no |
| A second crypto library beside a cloud provider | yes | no | no | yes |
| Key schedules zeroised | no | yes, by AWS-LC’s allocator | yes, by AWS-LC’s allocator | yes |
Every backend has ChaCha20-Poly1305, AES-128-GCM and AES-256-GCM, writes the same bytes, and decrypts the values of any other, so a move from one backend to another needs no migration of the data, see Cross-backend compatibility.
- Producers under an asymmetric KEK: a producer needs a backend with RSA encryption, so it
cannot run on
ring. Readers need nothing of RSA on any backend, see Accept data from partners and devices that cannot read it back; - No second crypto library: the default features of the cloud providers already build
aws-lc-rs for TLS, so
aws-lcadds nothing to a provider build, see aws-lc-rs and FIPS; - FIPS:
aws-lc-fipsruns the backend on the AWS-LC FIPS module and moves every user of aws-lc-rs in the build to it, the rustls provider included. AES-256-GCM is the algorithm for a FIPS deployment. AES-SIV, the deterministic algorithm, is not FIPS-approved and runs on RustCrypto whatever the backend, so deterministic fields stay outside the validated boundary, see aws-lc-rs and FIPS; - No C toolchain:
rustcryptois pure Rust; - Zeroisation: what each backend leaves in freed memory is in Crypto backends.
A build may enable several backends at once, and code generic over the backend bounds it with
B: AeadBackend and nothing else, see
Code generic over the backend.