Kser module allow you to encrypt and decrypt messages in kafka using libsodium.
First, install kser-crypto using pip:
$ pip install kser-crypto[pykafka]
Note
Only kafka-python is implemented at the moment.
Make sure to have the environment variable KSER_SECRETBOX_KEY definded.
from kser_crypto.python_kafka.consumer import CryptoConsumer
consumer = CryptoConsumer(config=dict(...), topics=[...])
consumer.run()
import time
from uuid import uuid4
from kser.schemas import Message
from kser_crypto.python_kafka.producer import CryptoProducer
producer = CryptoProducer(config=dict(...))
producer.send("test", Message(uuid=str(uuid4()), entrypoint="myTest"))
time.sleep(1)
- Python 3.x
- Libsodium
- Project: http://kser.readthedocs.io/
- Libsodium: https://download.libsodium.org/doc/
- confluent-kafka-python: http://docs.confluent.io/current/clients/confluent-kafka-python
- kafka-python: http://kafka-python.readthedocs.io/en/master/
- PyPI: https://pypi.python.org/pypi/kser-crypto
- Project issues: https://github.com/cdumay/kser-crypto/issues
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)