简体   繁体   中英

Encrypt Mongo data in Meteorjs

Is it possible to encrypt certain Mongodb field for particular collection when the document is being inserted? And then decrypt it while publishing the collection?

I'm not sure if this is overkill for your use case:

Mylar is a Meteor module which supports client-side encryption.

Mylar stores only encrypted data on the server, and decrypts data only in users' browsers. [...] Mylar allows the server to perform keyword search over encrypted documents, even if the documents are encrypted with different keys. [...] Finally, Mylar ensures that client-side application code is authentic, even if the server is malicious. Results with a prototype of Mylar built on top of the Meteor framework are promising

You didn't ask for a framework, but homebred security is often done wrong.

We have published a new package planifica:encryption that let's you do client-side encryption of your mongo collections with ease! If follows the same principles as Mylar does (in fact it is based on the paper that Mylar is based on), but currently does not support all of Mylars features like server-side search.
On the other hand it uses far more advanced and performant encryption techniques for key generation and encryption that are more suitable for browsers. Also it does not replace or modify the meteor core, but instead is a normal package that uses hooks for all the automatic en-/decryption.
There is also a blog post to get you started here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM