All Projects → QuickSign → kafka-encryption

QuickSign / kafka-encryption

Licence: Apache-2.0 license
Kafka End to End Encryption

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to kafka-encryption

Kattlo Cli
Kattlo CLI Project
Stars: ✭ 58 (+31.82%)
Mutual labels:  kafka-consumer, kafka-producer, kafka-streams
Kukulcan
A REPL for Apache Kafka
Stars: ✭ 103 (+134.09%)
Mutual labels:  kafka-consumer, kafka-producer, kafka-streams
qwery
A SQL-like language for performing ETL transformations.
Stars: ✭ 28 (-36.36%)
Mutual labels:  kafka-consumer, kafka-producer
Qbusbridge
The Apache Kafka Client SDK
Stars: ✭ 272 (+518.18%)
Mutual labels:  kafka-consumer, kafka-producer
Librdkafka
The Apache Kafka C/C++ library
Stars: ✭ 5,617 (+12665.91%)
Mutual labels:  kafka-consumer, kafka-producer
Kafka Ui
Open-Source Web GUI for Apache Kafka Management
Stars: ✭ 230 (+422.73%)
Mutual labels:  kafka-producer, kafka-streams
kafka-0.11-examples
Code snippets that demonstrate how to leverage the new Kafka 0.11 APIs
Stars: ✭ 17 (-61.36%)
Mutual labels:  kafka-consumer, kafka-producer
Kq
Kafka-based Job Queue for Python
Stars: ✭ 530 (+1104.55%)
Mutual labels:  kafka-consumer, kafka-producer
Kafka-quickstart
Kafka Examples focusing on Producer, Consumer, KStreams, KTable, Global KTable using Spring, Kafka Cluster Setup & Monitoring. Implementing Event Sourcing and CQRS Design Pattern using Kafka
Stars: ✭ 31 (-29.55%)
Mutual labels:  kafka-consumer, kafka-producer
Karafka
Framework for Apache Kafka based Ruby and Rails applications development.
Stars: ✭ 1,223 (+2679.55%)
Mutual labels:  kafka-consumer, kafka-producer
Trubka
A CLI tool for Kafka
Stars: ✭ 296 (+572.73%)
Mutual labels:  kafka-consumer, kafka-producer
Apachekafkatutorials
Example Code for Kafka Tutorials @ Learning Journal
Stars: ✭ 155 (+252.27%)
Mutual labels:  kafka-consumer, kafka-producer
Rafka
Kafka proxy with a simple API, speaking the Redis protocol
Stars: ✭ 49 (+11.36%)
Mutual labels:  kafka-consumer, kafka-producer
Strimzi Kafka Bridge
Apache Kafka bridge
Stars: ✭ 137 (+211.36%)
Mutual labels:  kafka-consumer, kafka-producer
Topos
🌀 .NET Event Processing library
Stars: ✭ 22 (-50%)
Mutual labels:  kafka-consumer, kafka-producer
kafka-serde-scala
Implicitly converts typeclass encoders to kafka Serializer, Deserializer, Serde.
Stars: ✭ 52 (+18.18%)
Mutual labels:  kafka-streams
kafka-proxy
Rust Kafka HTTP proxy
Stars: ✭ 25 (-43.18%)
Mutual labels:  kafka-producer
WeDefend
⛔🛡️ WeDefend - Monitor and Protect Windows from Remote Access Trojan
Stars: ✭ 23 (-47.73%)
Mutual labels:  encryption-tool
KafkaStream-CQRS-EventSourcing
Event Sourcing(CQRS) and Materialized views with Kafka Streams
Stars: ✭ 22 (-50%)
Mutual labels:  kafka-streams
SafePad
SafePad : Encrypted Text Editor. This text editor uses very strong encryption to let you protect your secrets. Great for storing passwords, credit card details or any else that you want to keep safe.
Stars: ✭ 32 (-27.27%)
Mutual labels:  encryption-tool

kafka-encryption

Build Status

Kafka-encryption is a Java framework that eases the encryption/decryption of Kafka record's value at the serializer/deserializer level.

Design goals

  • Support or allow multiple encryption key management strategies (KMS, embedded, per message, rolling windows, per tenant, custom)
  • Support for Kafka Streams intermediate topics
  • Detect when a payload is not encrypted to skip decryption
  • Support for Spring Boot
  • Support for Camel

Customization

This framework exposes some high level Interfaces to let you customize the crypto Serializer/Deserializer internals.

This framework is used on our platform. For obvious reason we do not reveal here our custom implementations of these interfaces. They would probably be useless to you anyway.

However, and this is the good news, we provide in our examples some working implementations that you can definitely leverage.

Terminology & basic explanation.

As you explore the code or the examples, you may get confused by the terminology used.

Do not confuse the Kafka record's key and the encryption key that is used to encrypt the record's value.

You may also get confused by what we call a key name and a key reference.

A key name is in general used to lookup an encryption key in a repository, but it could also be the encryption key itself.

A key reference or key ref is derived from the key name. It can be for example an obfuscated or encrypted version of the key name. The key ref is stored in the record's value as a prefix of the encrypted value. .

Examples

We provide 3 examples that work out of the box. Do not use their code as is in production (we don't). Hopefully you can replace some of the implementations provided in the examples with your own.

TIP: When studying the samples' code, to ease your pain start by studying 
the SamplesMain and SampleProducer.

Example 1 - samples/generatedkey-sample : one encryption key per record

This example uses the classic consumer API. It neither relies on the record's key nor on an encryption key repository. Instead the encryption key is encrypted and transmitted in the record's value.

As a developer using the framework, in this example we provide 2 custom implementations to support our need. These implementations are used to construct the CryptoSerializerPairFactory.

Here is roughly what this example demonstrates:

Serializer

  • Generates a new encryption key for each record
  • Encrypts the record's value using the encryption key (see AesGcmNoPaddingCryptoAlgorithm).
  • Uses the master encryption key (see KeyStoreBasedMasterKey) to encrypt the encryption key. The encrypted encryption key is the key ref. Note that the master encryption key is stored in a Java KeyStore which is itself protected by a password.

Deserializer

  • It extracts the key ref from the record's value.
  • Uses the master encryption key (see KeyStoreBasedMasterKey) to decrypt the encryption key out of the key ref.
  • Decrypts the record's value using the encryption key (see AesGcmNoPaddingCryptoAlgorithm).

Example 2 - samples/kafkastreams-with-keyrepo-sample : one encryption key per record

This example uses the Kafka Streams API. It creates a KTable, its content is also encrypted. We use one encryption key per record's key. The encryption key is stored in Java KeyStore, it is not transmitted in the record's value.

As a developer using the framework, in this example we provide 4 custom implementations to support our need. These implementations are used to construct the CryptoSerializerPairFactory.

Here is roughly what this example demonstrates:

Serializer

  • Uses the record's key as the key name (see SampleKeyNameExtractor)
  • Using the key name, looks up the encryption key from the KeyStoreBasedKeyRepository
  • Uses the SampleKeyNameObfuscator provided to create the key ref by simply swapping some bytes from the key name.
  • It encrypts the record's value using encryption key (see AesGcmNoPaddingCryptoAlgorithm)

Deserializer

  • Extracts the key ref from the record's value
  • Uses the SampleKeyNameObfuscator to obtain the key name out of the key ref
  • Looks up the encryption key from the KeyStoreBasedKeyRepository using the key name
  • Decrypts the record's value using the encryption key (see AesGcmNoPaddingCryptoAlgorithm)

Example 3 - samples/keyrepo-sample : one encryption key per record's key.

This example uses the classic consumer API. There is one encryption key per record's key. The encryption key is stored in an in memory encryption key repository, it is not transmitted in the record's value.

As a developer using the framework, in this example we provide 4 custom implementations to support our need. These implementations are used to construct the CryptoSerializerPairFactory.

Here is roughly what this example demonstrates:

Serializer

  • Uses the record's key as the key name (see SampleKeyNameExtractor)
  • Using the key name, looks up the encryption key from the SampleKeyRepository, a basic in memory encryption key repository.
  • Uses the SampleKeyNameObfuscator provided to create the key ref by simply swapping some bytes from the key name.
  • It encrypts the record's value using encryption key (see AesGcmNoPaddingCryptoAlgorithm)

Deserializer

  • Extracts the key ref from the record's value
  • Uses the SampleKeyNameObfuscator to obtain the key name out of the key ref
  • Looks up the encryption key from the SampleKeyRepository using the key name
  • Decrypts the record's value using the encryption key (see AesGcmNoPaddingCryptoAlgorithm)

Troubleshooting

In case the docker compose provided in the examples to run Kafka does not work for you, you may use this command:

On OSX and Windows

docker run --rm -p 2181:2181 -p 3030:3030 -p 8081-8083:8081-8083 -p 9581-9585:9581-9585 -p 9092:9092 -e ADV_HOST=192.168.99.100 landoop/fast-data-dev:2.0.1

On linux

docker run --rm --net=host -e ADV_HOST=localhost landoop/fast-data-dev:2.0.1
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].