feat(encryption) [1/N] Support encryption: Add crypto for AES-GCM#2026
Open
xanderbailey wants to merge 2 commits intoapache:mainfrom
Open
feat(encryption) [1/N] Support encryption: Add crypto for AES-GCM#2026xanderbailey wants to merge 2 commits intoapache:mainfrom
xanderbailey wants to merge 2 commits intoapache:mainfrom
Conversation
44020d9 to
c5299d9
Compare
c5299d9 to
d9e4e2f
Compare
Collaborator
|
This is awesome! I will take a look since I did a lot of the PME support in Comet. Regarding AES-256-GCM support, last I looked Arrow-rs' Parquet reader only supported 128. Is that not the case anymore? |
Author
|
You are correct by the looks of it! https://github.com/apache/arrow-rs/blob/main/parquet/src/encryption/ciphers.rs |
|
@xanderbailey Thank you for the great work on encryption support! Regarding arror-rs, I removed the hardcoded AES-128 constraint w/ apache/arrow-rs#9203, hope that helps a bit. Because we're using PME with AES-256 cc @mbutrovich |
Author
|
This helps a bunch thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Core Encryption Primitives for Iceberg Encryption Support.
Part of #2034
Summary
This PR introduces the foundational cryptographic primitives needed for implementing encryption in iceberg-rust, providing AES-GCM encryption operations that match the Java implementation's behavior and data format.
Motivation
Iceberg's Java implementation supports table-level encryption to protect sensitive data at rest. To achieve feature parity and ensure interoperability between Java and Rust implementations, we need to build encryption support from the ground up. This PR provides the core cryptographic operations that will serve as the foundation for the complete encryption feature.
Changes
New Module: encryption
Added a new encryption module with core AES-GCM cryptographic operations:
Key Features
[12-byte nonce][encrypted data][16-byte GCM authentication tag]
- Round-trip encryption/decryption for both AES-128 and AES-256
- AAD validation
- Empty plaintext handling
- Tamper detection
- Format compatibility verification
Dependencies Added
Compatibility
This implementation directly corresponds to Java's https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/encryption/Ciphers.java:
Testing
Future Work
This PR is the first in a series to implement full encryption support. Upcoming PRs will add:
Review Notes
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?
Yes