StaticconfigureConfigure the global AES-256-GCM key.
Configure the global encryption key. Call once at app startup before any encrypted models are used.
A 32-byte key as a hex string (64 hex chars) or raw Buffer.
StaticencryptManually encrypt a value.
Encrypt a plain-text value.
Returns a prefixed base64 string: "enc:v1:
StaticdecryptManually decrypt a value.
Decrypt a value produced by encryptValue(). Returns the original plain-text string.
StaticisCheck if a value is already encrypted.
Checks whether a value is already in encrypted form (prefixed with enc:v1:), used to avoid double-encrypting.
StaticapplyWire hooks onto a model.
Wire beforeSave and afterFind hooks onto a model to transparently encrypt on write and decrypt on read.
Call once per model after it is defined: applyEncryptionHooks(User);
StaticgetGet the list of encrypted fields on a model.
Get the list of fields marked for encryption on a model class.
Convenience class grouping the encryption API.