用nodejs + angularjs + mongoose加密所有数据

Encrypt all data with nodejs + angularjs + mongoose

我想加密保存在 mongoose 中的所有数据。你知道 nodejs 中的一些插件或模块吗?我怎样才能在前端使用 angularjs 有效地做到这一点?

例如:我正在使用聊天系统,使用 socket.io。我将消息存储在这个模型中:

 var messageSchema = new Schema({
     type: {
      type: String,
      required: false
    },
  user: {
    type: String,
    default: '',
    trim: true
  },
  content: {
      type: String,
      default: '',
      trim: true
  },
  slug: {
      type: String,
      lowercase: true,
      trim: true
  },
  created: Date,
  updated: [Date],
  roomCreator: {
      type: Schema.ObjectId,
      ref: 'Room'
  },
});

我希望尽可能以最安全的方式对所有这些数据进行加密,这样任何人都无法看到消息的任何内容。 提前致谢

有这个: ChatSafe

虽然我不确定我对此的感受。它有能力使用不同的密码密钥,但它没有从一个客户端获取密钥到另一个客户端的固有方法,这是解密消息所必需的(显然你必须向它们发送 url,这是其他方式客户端获得密码密钥)。很酷的是,它在客户端进行了所有加密。

我想我会做这个:Implement AES Strength Encryption With JavaScript 它向您展示了如何构建基于客户端 angular 的加密服务。

加密客户端的所有内容>将其发送到节点> save/do随便>发送给其他客户端>解密客户端。