Optionaloptions: DataMaskingConstructorOptionsDecrypts data using the configured provider.
A string input is treated as a full encrypted payload; an object input is
deep copied and the values at fields are decrypted in place.
The encrypted payload string or an object holding encrypted fields
Optionaloptions: DecryptOptions
Options for the operation, see DecryptOptions
Encrypts data using the configured provider.
With fields, encrypts the matched values in place and returns a deep copy;
without fields, encrypts the entire payload into a single string.
The data to encrypt
Optionaloptions: EncryptOptions
Options for the operation, see EncryptOptions
Irreversibly masks the entire payload with the default mask value: arrays element-wise preserving their length, and everything else with a single mask string.
The data to mask; returned as-is when null or undefined
Irreversibly masks fields in a data object and returns a deep copy.
The options compose three layers (see EraseOptions):
MaskingRule (regexPattern + maskFormat, dynamicMask,
or customMask) sets the default masking strategy;fields selects the paths to mask with that strategy — when omitted, a
top-level rule is applied to every leaf value in the payload;maskingRules provides per-field rules that take precedence over the
top-level rule for the paths they name.The data to mask; returned as-is when null or undefined
Options for the operation, see EraseOptions
Orchestrates erasing, encrypting, and decrypting sensitive data.
Example