How to ECDH Implement in Microservices

6/24/2019

I have a problem when I want to encrypt decrypt data by use the same key in every services.I use ECDH Method to encrypt decrypt data between client and server. I have a exchangeKey service to gen Key send back to client and obtain pubkey from client and then compute share secret key to get common key but I have a problem when I want to use the same key in other containners in k8s to encrypt decrypt data from a same client. so what is the best practice to let others container knows what key they gotta use to do encrypt or decrypt to or from the same client in every containers after compute share secret key from exchange key service.

-- Yao Pitak
cryptography
kubernetes
microservices

1 Answer

6/26/2019

After I research, I got a solution that I should Use Redis Containers to store session data like key that I want to share to others containers and when others container want to encrypt or decrypt they will request to Redis container to fetch the get each client key . But I'm not sure about a performance to read write from redis container. But redis do store in the ram. I guess that it would be better than store in DB

-- Yao Pitak
Source: StackOverflow