Meteor Server Encryption
Server side collection field encryption using Crypto AES and Collection Hook
Please refer to History.md for a summary of recent changes.
Getting Started
Installation:
meteor add escu:encryption
Encrypt Collection
Specify your collection and fields to encrypt.
var TestCollection = new Mongo.Collection('test');
Meteor.startup(function() {
if (Meteor.isServer) {
EncryptCollection(TestCollection, ['field1', 'field2']);
}
});
Decrypt Collection
Specify your collection and fields to decrypt.
Meteor.startup(function() {
if (Meteor.isClient) {
DecryptCollection(TestCollection, ['field1', 'field2']);
}
});
Supports sub fields
Can encrypt/decrypt sub fields up to 4 level.
EncryptCollection(TestCollection, ['field.field', 'field.field.field']);
DecryptCollection(TestCollection, ['field.field', 'field.field.field']);
Constraints
- Fields with array values not supported.
Encryption options
Passphrase
By default package has its passphrase littleRabbitJumper123
. I recommend to define your own.
EncryptionUtils.passphrase('passphrase');
Important: Should be defined on both server and client.
Maintainer
- John Edward Escuyos (jeescu)