Determining what unique key masking to use
imitate_unique is the recommended default
for unique masking. The other three options below are deprecated. They are documented here so that
you can recognise them in an existing ruleset and choose what to replace them with.
imitate_uniquemask_unique_key(deprecated)from_unique(deprecated)from_unique_imitate(deprecated)
imitate_unique
Use Case:
- The recommended default for unique masking. Best for deterministic, format-preserving masking of strings or integers with physical FK propagation.
Key Features:
- Deterministic, unique values for unique input.
- Supports custom character sets, checksum validation, and prefix/suffix preservation.
- Propagates masked PK values to physical FK columns.
- Increases security over
from_unique_imitateby preventing repeated series of characters in a single value from masking identically. - Guarantees consistent values across runs or databases with the same
run_secretandseed.
mask_unique_key
Deprecated: Use a
mask_tabletask with theimitate_uniquemask on the key column instead, unless you need logical foreign key propagation. See Mask a primary key or unique key.
Use Case:
- Best for generating unique values and propagating these to both physical and logical foreign key (FK) columns.
Key Features:
- Allows specifying the data format.
- Generates unique values.
- Propagates to physical and logical FK columns.
- Disallows
hash_columnson itself or other columns. - Ensures primary key (PK) columns are unique before masking.
- No guaranteed consistency across masking runs or databases.
from_unique
Deprecated: Use a
mask_tabletask with theimitate_uniquemask on the key column instead.
Use Case:
- Ideal for generating unique values without the need for FK column propagation.
Key Features:
- Allows specifying the data format.
- Generates unique values.
- Disallows
hash_columnson itself or other columns. - Does not propagate masked PK values to physical and logical FK columns. 5.No guaranteed consistency across masking runs or databases.
from_unique_imitate
Deprecated: Use a
mask_tabletask with theimitate_uniquemask on the key column instead.
Use Case:
- Used when consistent values across masking runs or databases are required, and FK relationships are needed to be maintained without specifying data format.
Key Features:
- Does not allow data format specification.
- Hashes on itself and generates unique values.
- Propagates masked PK values to physical and logical FK columns.
- Guarantees consistent values across runs or databases with the same
run_secret.