I have a simple chat app running internally in my office using Node/Socket.io/MongoDB.
Now, I would like to figure out the most effective way to encrypt the chats in the MongoDB for security/privacy purp开发者_StackOverflow社区oses.
What would be the most effective and efficient way to do this?
Thank you.
Encrypting content is something you would typically do on the client side, in your app layer so to speak - which in your case is the node.js based code.
MongoDB wouldn't know anything about this encryption. You store encrypted data into MongoDB and you get back the same. It is your responsibility to explicitly decode the contents after a read.
There are several alternatives available too. There are tools which do encryption at the filesystem level.
Either ways, MongoDB will not have anything to do with it. It just stores whatever data you give it and returns back the same data when you ask for it.
More details here : https://security.stackexchange.com/questions/3026/encrypting-with-mongo
精彩评论