Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 502
fardeem Avatar asked Nov 10 '14 01:11

fardeem


People also ask

Can we encrypt data in MongoDB?

MongoDB Enterprise 3.2 introduces a native encryption option for the WiredTiger storage engine. This feature allows MongoDB to encrypt data files such that only parties with the decryption key can decode and read the data.

How do I encrypt a field in MongoDB?

Enforce Field Level Encryption Schema Starting with MongoDB 4.2, the server supports using schema validation to enforce encryption of specific fields in a collection. Use the automatic encryption rule keywords with the $jsonSchema validation object to indicate which fields require encryption.

Is Mongodump encrypted?

On the client side, mongodump does not encrypt the data when writing. This means that if you need the backup to be encrypted, you will need to encrypt the backup files after the backup completes.

Does MongoDB support TDE?

To encrypt data at rest, MongoDB Enterprise offers native, storage-based symmetric key encryption at the file level. Whole database encryption is also called Transparent Data Encryption (TDE).


1 Answers

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.

like image 118
Christian Strempfer Avatar answered Sep 20 '22 10:09

Christian Strempfer