feat: Add field-level encryption for sensitive properties#18
Open
PieterjanDeClippel wants to merge 1 commit into
Open
feat: Add field-level encryption for sensitive properties#18PieterjanDeClippel wants to merge 1 commit into
PieterjanDeClippel wants to merge 1 commit into
Conversation
…rties
Introduces AES-256-GCM encryption for string properties marked with
[Encrypted]. Encrypted values are stored as opaque ENC:v1:{iv}:{ct}:{tag}
blobs, enabling safe replication via RavenDB ETL between modules. Each
module uses its own key, with cross-module keys for decrypting replicated
data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
MintPlayer.Spark.Encryption.Abstractionsproject with[Encrypted]attribute andSparkEncryptionOptions(OwnKey + ModuleKeys)MintPlayer.Spark.Encryptionproject with AES-256-GCM encrypt/decrypt, hooking intoIDocumentStore.OnBeforeStore/OnAfterConversionToEntityeventsENC:v1:{iv}:{ciphertext}:{tag}blobs — safe for RavenDB ETL replication between modules[Replicated(SourceModule)]attribute — consuming modules decrypt with the source module's key[Encrypted]is used on non-string propertiesOwnKeyis not configuredCar.VinNumberencrypted at rest, replicated as encrypted blob to HR, decrypted on read in both modulesTest plan
dotnet build MintPlayer.Spark.slncompiles with no errors[Encrypted]to anintproperty → confirm startup throwsInvalidOperationExceptionENC:v1:...blob🤖 Generated with Claude Code