Configuration for the encryption middleware.
const config: EncryptionConfig = { key: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", encryptedFields: [{ model: "User", fields: ["email", "phone"] }], algorithm: "xchacha20-poly1305", deterministicFields: ["email"],}; Copy
const config: EncryptionConfig = { key: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", encryptedFields: [{ model: "User", fields: ["email", "phone"] }], algorithm: "xchacha20-poly1305", deterministicFields: ["email"],};
Hex-encoded 256-bit encryption key.
Models and fields to encrypt.
Optional
Encryption algorithm. Default: "xchacha20-poly1305".
Whether to use deterministic encryption for searchable fields.
Configuration for the encryption middleware.
Example