Crypto Shredding: Data Compliance in an Immutable World

Event-driven architectures are built on a powerful idea: events arefacts.

Once something has happened, we record it. In platforms like ApacheKafka, those events can stay available for long periods, so applications canreplay history, rebuild state, and create entirely new data products.

But that architectural principle sits in tension with modern dataprivacy requirements.

What happens when immutable events containpersonal information that you're required to delete?

That was the central question in a recentinternal session at Cymo. The proposed solution combines field-level encryption, crypto shredding, and a transparent Kafkagateway to keep sensitive data manageable, without giving up the advantagesof immutable event streams.

Key takeaway #1

Destroy the key, not the data: With crypto shredding, sensitive fieldsare encrypted before they're written to Kafka. Destroy the keys linked to aperson, and their information can no longer be decrypted, while the recordsthemselves stay in the log.

Key takeaway #2

One mechanism, two privacy controls: Subject-level keys enable cryptoshredding, while classification-level keys determine which categories ofinformation an application can decrypt. Described in the event schema andenforced through JWT claims, this gives you field-level access control.

Key takeaway #3

Privacy becomes a platform capability: A transparent gateway means teams nolonger have to implement privacy one application at a time. It does movecomplexity to key management, performance, schema evolution, and tooling.

Crypto Shredding: Data Compliance in an Immutable World

Event-driven architectures are built on a powerful idea: events arefacts.

Once something has happened, we record it. In platforms like ApacheKafka, those events can stay available for long periods, so applications canreplay history, rebuild state, and create entirely new data products.

But that architectural principle sits in tension with modern dataprivacy requirements.

What happens when immutable events containpersonal information that you're required to delete?

That was the central question in a recentinternal session at Cymo. The proposed solution combines field-level encryption, crypto shredding, and a transparent Kafkagateway to keep sensitive data manageable, without giving up the advantagesof immutable event streams.

Key takeaway #1

Destroy the key, not the data: With crypto shredding, sensitive fieldsare encrypted before they're written to Kafka. Destroy the keys linked to aperson, and their information can no longer be decrypted, while the recordsthemselves stay in the log.

Key takeaway #2

One mechanism, two privacy controls: Subject-level keys enable cryptoshredding, while classification-level keys determine which categories ofinformation an application can decrypt. Described in the event schema andenforced through JWT claims, this gives you field-level access control.

Key takeaway #3

Privacy becomes a platform capability: A transparent gateway means teams nolonger have to implement privacy one application at a time. It does movecomplexity to key management, performance, schema evolution, and tooling.

Crypto Shredding: Data Compliance in an Immutable World

Event-driven architectures are built on a powerful idea: events arefacts.

Once something has happened, we record it. In platforms like ApacheKafka, those events can stay available for long periods, so applications canreplay history, rebuild state, and create entirely new data products.

But that architectural principle sits in tension with modern dataprivacy requirements.

What happens when immutable events containpersonal information that you're required to delete?

That was the central question in a recentinternal session at Cymo. The proposed solution combines field-level encryption, crypto shredding, and a transparent Kafkagateway to keep sensitive data manageable, without giving up the advantagesof immutable event streams.

Key takeaway #1

Destroy the key, not the data: With crypto shredding, sensitive fieldsare encrypted before they're written to Kafka. Destroy the keys linked to aperson, and their information can no longer be decrypted, while the recordsthemselves stay in the log.

Key takeaway #2

One mechanism, two privacy controls: Subject-level keys enable cryptoshredding, while classification-level keys determine which categories ofinformation an application can decrypt. Described in the event schema andenforced through JWT claims, this gives you field-level access control.

Key takeaway #3

Privacy becomes a platform capability: A transparent gateway means teams nolonger have to implement privacy one application at a time. It does movecomplexity to key management, performance, schema evolution, and tooling.

The problem with sensitive data in Kafka

Imagine an event stream with employee information.

A single event might combine ordinary business information withseveral categories of sensitive information:

  • personallyidentifiable information (PII)
  • financialinformation
  • healthinformation

In Kafka, these events may be replicatedand retained as part of an immutable log. That makes locating and removingevery historical event belonging to one individual difficult.

And there's a second challenge.

Not every application that consumes a topic should have access toevery field. One application might legitimately need a person's identity, buthave no reason to see their financial information.

Traditional Kafka authorization mainly controls access at the topiclevel. The architecture discussed in the session adds another level of control:which sensitive fields a particularclient can decrypt.

Instead of deleting the data, destroy the ability to read it

This is where cryptoshredding comes in.

Instead of storing sensitive fields as plaintext, you encrypt them before they're written to Kafka. Theencryption keys are linked to the data subject and the data classification.

If the keys linked to a particular person are later destroyed,their encrypted information can no longer be decrypted.

The Kafka records themselves can stay inthe log, but the sensitive information inside them becomes inaccessible.

That turns the question:

"How do we physically remove specific records from animmutable event log?"

into: "How do we securely manage the keys that determine whetherthose records remain readable?"

Two layers of encryption

The approach uses two layers of key management.

First, individual sensitive fields are protected with data encryption keys. Those keys can belinked to a specific subject and data classification.

But the data encryption keys themselves aren't simply stored asplaintext either.

They're encrypted again with higher-level keys tied toclassifications such as PII, financial, or health information. Those masterkeys can then be managed in a key-management solution like Azure Key Vault.

This creates an important separation:

Subject-level keys determine which individual data can still bedecrypted.

Classification-level keys help determine which categories ofinformation an application can access.

That gives you two different privacy controls from the samearchitecture.

1.Crypto shredding

Remove the keys that belong to a particular subject, and theirencrypted information can no longer be decrypted.

2.Field-level access control

Control access to the classification keys, and different consumerscan see different subsets of the same event.

For example, one application could decrypt PII but not financialinformation.

Making encryption transparent to applications

A key architectural decision is where encryption and decryption happen.

Rather than building cryptographic logic into every producer andconsumer, the proposed solution places it in a gateway between Kafka clients and the Kafka cluster.

The intended model looks roughly like this:

From the application's perspective, encryption becomes largely aninfrastructure concern rather than application logic.

The session included a proof of concept in which multiple clientsconsumed the same underlying Kafka data, but received different resultsdepending on their access. A client with broader permissions could seedecrypted fields, while a client without the required access received aplaceholder instead of the protected financial value.

Put privacy into the event contract

Another important design choice is to describe encryptionrequirements directly in the eventschema.

Instead of maintaining a separate configuration that lists whichfields are sensitive, the schema itself can identify:

  • the fieldrepresenting the data subject;
  • whichfields require encryption;
  • theclassification associated with those fields.

The presentation used a simplified Avro example to illustrate this.It keeps privacy metadata close to the contract that defines the data itself.

That matters as much organizationally as it does technically.

Whether a field contains PII or financial information isn't just animplementation detail. It's part of the meaning and governance of that data.

Identity becomes part of data access

Encryption alone isn't enough. The gateway also needs to know who is requesting the data.

The implementation discussed in the sessionuses claims from the JWT that a client presents when it connects to theplatform. The gateway can inspect those claims and use them to decide whichclassifications the client is allowed to decrypt.

As a result, authorization is no longer only about:

Can this application consume this topic?

It can also cover:

Which information inside those events is this application allowedto see?

The architecture introduces new trade-offs

Crypto shredding is powerful, but it also changes the risk profileof your platform.

Keymanagement becomes critical

If the encrypted data is still availablebut its keys are accidentally lost, that data may effectively be lost too.That's why the discussion highlighted backup and key-management strategy ascritical architectural concerns.

Encryptionhas a performance cost

Encrypting and decrypting in the gatewayadds processing, and therefore latency. The proposed mitigation is ahorizontally scalable gateway rather than a single instance.

Schemaevolution gets more complicated

Changing a field's classification maychange which keys are needed to decrypt historical versus new versions of anevent. The discussion explicitly flagged schema evolution and classificationchanges as areas that need careful handling.

Kafkatooling needs consideration

Tools that connect directly to Kafka seeencrypted values instead of decrypted information. Managed connectors and othertooling that don't go through the gateway may therefore need extraarchitectural attention.

None of these are arguments against the architecture. They'reimportant reminders that cryptographymoves complexity rather than eliminating it.

From application concern to platform capability

The strongest aspect of this approach isn't the encryption itself.Encryption is well understood.

What makes it valuable is turning privacy into a platform capability.

Without a centralized approach, every development team has tofigure out for itself how to protect sensitive fields, manage encryption keys,and implement access policies.

A gateway-based model lets you handle muchof that complexity consistently across producers and consumers. The sessionhighlighted this transparency as one of the key advantages of the approach.

For organizations running event-driven platforms at scale, that's asignificant shift:

Privacy stops being something every application has to implementindependently and becomes a capability of the event platform itself.

Conclusion: the bigger lesson

At first sight, immutable event streams and privacy requirementslook fundamentally incompatible.

They don't have to be.

Crypto shredding reframes deletion. Instead of modifying historicalevents, you design sensitive information so that its accessibility depends oncryptographic material that can itself be destroyed.

Combined with field-level encryption, identity-aware access, and atransparent gateway, the same mechanism also gives you more granular controlover who can see sensitive information.

The session also made clear that there are still open questionsaround key management, performance, schema evolution, and integration withsurrounding tooling.

But that's exactly what makes the topic worth exploring.

As event-driven architectures become more central to enterprisedata landscapes, privacy and datagovernance need to become first-class architectural concerns, not controlsadded afterwards.

Crypto shredding offers a compelling pattern to make exactly thathappen.

 

Want to make privacy a capability of yourevent-driven platform rather than a concern for every team? Don't hesitate toreach out.

Let's discuss your data compliance strategy

‍

We value your privacy! We use cookies to enhance your browsing experience and analyse our traffic.
By clicking "Accept All", you consent to our use of cookies.
Dark blue outline of a cookie icon.