Hex-encoded 256-bit encryption key.
Models and fields to encrypt.
OptionalalgorithmEncryption algorithm. Only "xchacha20-poly1305" is implemented;
the option is accepted for forward compatibility and currently has
no effect.
OptionaldeterministicFields stored as an HMAC-SHA-256 blind index instead of ciphertext,
so they can be matched exactly in where clauses. Reads return the
stored MAC, not the plaintext: the blind index is one-way.
OptionalallowReturn a stored value as-is when it is not a ciphertext at all,
instead of throwing a FieldDecryptionError. Meant only for the
window in which existing plaintext rows are being migrated. A value
in the v2: format that fails authentication is always rejected.
OptionalacceptAccept legacy ciphertexts written before the v2: format (sealed
with the configured key and no associated data). Legacy values are not
bound to their model and field, so anyone able to write the database could
move one into another encrypted field. Set this only while
re-writing old rows, then remove it.
OptionalblindKey used for the blind index of deterministicFields.
"legacy": HMAC with the configured key, as in earlier versions,
so existing index values keep matching."hkdf": HMAC with a subkey derived by HKDF-SHA-256
(info crypto-prisma/bidx/v1). Every stored index value must be
recomputed when switching an existing database to this mode.
Configuration for the encryption middleware.
Example