Documentation
¶
Overview ¶
Example: GDPR PII encryption and crypto-shredding lifecycle with PostgreSQL.
In event-sourced architectures, events are immutable and cannot be deleted. Crypto-shredding solves GDPR's "Right to Erasure" (Article 17) by:
- Generating 1 dedicated DEK (version 1) per user: (scope="user_pii", scopeID=userID).
- Encrypting all user PII payloads in the event stream with this single pinned DEK.
- When an erasure request arrives, calling store.DestroyKeys(ctx, conn, "user_pii", userID) to hard-delete the DEK from PostgreSQL.
- Without the DEK, historical events remain in the event store but are mathematically undecryptable noise, fulfilling GDPR erasure without violating event immutability.
Click to show internal directories.
Click to hide internal directories.