Skip to content

feat(encryption): add EncryptionManager and StandardEncryptionManager - #1071

Open
shangxinli wants to merge 2 commits into
apache:mainfrom
shangxinli:pr-enc06-encryption-manager
Open

shangxinli wants to merge 2 commits into
apache:mainfrom
shangxinli:pr-enc06-encryption-manager

Conversation

@shangxinli

Copy link
Copy Markdown
Contributor

Part of the envelope encryption stack for #988.

Adds EncryptionManager/EncryptionManagerRegistry (the pluggable manager interface
and factory) and StandardEncryptionManager, the envelope encryption manager compatible
with Java's StandardEncryptionManager:

  • Table master key in the KMS, key encryption keys (KEKs) wrapped by the KMS and rotated
    every 730 days (NIST SP 800-57), manifest-list key metadata AES-GCM encrypted by a KEK
    with the KEK timestamp as AAD.
  • Unwrapped KEKs are cached for one hour.
  • Thread-safe: all mutable state is guarded by a single mutex.

Gated behind ICEBERG_ENCRYPTION, registered in CMakeLists.txt, with a new crypto_test
target covering manifest-list key decryption against a Java-produced fixture, key
registration/decryption round trips, KEK rotation, and unwrapped-key cache expiry.

shangxinli and others added 2 commits October 30, 2026 09:32
- EncryptionManager (core): per-table interface to generate key
  metadata, open AES GCM Stream files for reading and writing, and
  encrypt and decrypt manifest list key metadata.
- EncryptionManagerRegistry (core): creates the manager of an encrypted
  table from the trusted table key ID, the table's encryption-keys and
  the catalog's KMS client. The bundle registers the implementation, so
  the core library has no crypto dependency.
- StandardEncryptionManager (bundle): Java's envelope encryption. Key
  encryption keys are wrapped by the table master key in the KMS,
  timestamped, used for 730 days and then rotated; manifest list key
  metadata is encrypted by a KEK with the KEK timestamp as AAD.
  Unwrapped KEKs are cached for one hour. Thread-safe.
- encryption::RegisterAll() / IsEncryptionAvailable() in the bundle; a
  no-op when built with ICEBERG_ENCRYPTION=OFF.

Adds the Java-written encrypted table fixture under
test/resources/encryption/table. Tests decrypt the manifest list key
metadata of every Java snapshot and check that its file length is the
stored size of the manifest list.
Resolves modernize-use-designated-initializers clang-tidy warnings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant