Server side collection field encryption using Crypto AES and Collection Hook
Please refer to History.md for a summary of recent changes.
Installation:
meteor add escu:encryption
Specify your collection and fields to encrypt.
var TestCollection = new Mongo.Collection('test');
Meteor.startup(function() {
if (Meteor.isServer) {
EncryptCollection(TestCollection, ['field1', 'field2']);
}
});Specify your collection and fields to decrypt.
Meteor.startup(function() {
if (Meteor.isClient) {
DecryptCollection(TestCollection, ['field1', 'field2']);
}
});Can encrypt/decrypt sub fields up to 4 level.
EncryptCollection(TestCollection, ['field.field', 'field.field.field']);
DecryptCollection(TestCollection, ['field.field', 'field.field.field']);- Fields with array values not supported.
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.
- John Edward Escuyos (jeescu)