This is a Demo application to demonstrate encryption of user senstative data (like chat conversations with support operator) into Kafka queues.
Users are created using a REST API (See Swagger)
Users holds a unique RSA encryption pair per user. This is used to encrypt messages per user.
The main Chat page
After login (tim/sausges) place a test message and see the message that was saved in Kafak (encrypted) and the message after decryption
Check the log to see the inner process of message flow through the system.
The encryption and decryption of messages is performed in two steps.
The RSA key pair is generated per user and stored in the user profile in MongoDB
Messages encrypted using DES Symetric key. this is because the RSA encryption is limited by content size and can only do messages based on the key size. DES Symteric is not limited. The encrypted message is saved into the message body
The symmetric key (used in step 1) is encrypted using the user public key. The encrypted symmetric key is saved into the message. Messages is pushed to Kafka queue.
When a user private key is removed, any messages in the queue encrypted with the user key are not accessible anymore. Because each message is encrypted with a different symmetric key, even if one message key was discovered none of the other messages are jeopardised.
- Repository
- Service
- Proxy
- Oepn API 3
Ths demo uses few technologies to accomplish the workflow
- Eclipse Vertx.io
- Web API / OpenAPI 3
- Swagger
- Service Proxy
- Shiro auth
- ThymeLeafe
- SockJS
- Apache Kafka Client
- MongoDB Client
- Java Cipher
- RSA
- DES
- Docker/Compose
- Zookeeper
- Apache Kafka
- MongoDB
- JUnit 5
- Flapdoodle (mongo test)
- Vertx Extention
- javaFaker
./mvnw clean test
./mvnw clean package
start docker services
docker-compose up
start the application
java -jar target/patterns-0.0.1-SNAPSHOT-fat.jar
login using the main chat page