I use NServiceBus with MSMQ between my web application and the service, and I need to be able to encrypt the message payload so that if the message is queued locally on the web server (the service node is down), the confidential information cannot be viewed.
Since the web server is open, I am not only obligated to encrypt data that can be serialized to disk anyway, but I also cannot save the encryption key on the web server.
I examined the use of DPAPI to store the key, but since the key will be stored on the host, I donβt know if this contradicts the requirement or not. Another option that I considered is that when you start a web application, it can request a key from a service and hold it in memory for the life of the application pool.
I have not had to work with this level of encryption requirements before, and would like to know what others are doing and get some feedback on the ideas mentioned above.
security c # encryption nservicebus
Mark j miller
source share