code: function decryptEntity(data, modelObj) {
        if (typeof data !== 'object' || !data) return;
        let encrypted = modelObj.getEncrypted();
        for (let i = 0, len = encrypted.length; i < len; i++) {
          let fieldName = encrypted[i],
            fieldValue = data[fieldName];
          if (typeof fieldValue !== 'string') continue;
          if (!crypto.isEncrypted(fieldValue)) continue;
          let decrypted = crypto.decrypt(fieldValue, opt.key);
          if (decrypted === null) {
            logger.warn(`Could not decrypt field ${fieldName} of entity`);
            logger.debug(data);
            continue;
          }
          data[fieldName] = decrypted;
        }
        /* now check foreign relations */
        if (!modelObj.hasRelationFields()) return;
        let relations = modelObj.getRelationFields();
        for (let i = 0, len = relations.length; i < len; i++) {
          let relation = relations[i];
          if (typeof data[relation.field] === 'undefined') continue;
          let relationModel = storeObj.model(relation.model, true);
          if (!relationModel.hasEncryptedFields()) continue;
          if (data[relation.field] instanceof Array) {
            for (let j = 0; j < data[relation.field].length; j++) {
              decryptEntity(data[relation.field][j], relationModel);
            }
          } else if (typeof data[relation.field] === 'object' && data[relation.field]) {
            decryptEntity(data[relation.field], relationModel);
          }
        }
      }
docs: /*
  Recursively decrypt entity data