The Character Mapping framework maps text values, defined by a set of character groups, to other text values generated from the same character groups. Mappings are calculated algorithmically, so it is not necessary to provide the set of mapping values. The algorithm preserves any characters not assigned to a group. Any characters from the first Unicode plane can be mapped - this covers most characters used in modern languages. Other (supplementary) characters can only be preserved.
The particular set of permutations used is determined by the algorithm's key, so rekeying the algorithm will cause different outputs to be generated for each input.
The algorithm has the following properties:
-
The masked value for each input is consistent unless the algorithm is rekeyed.
-
No two text inputs produce the same text output. Collisions are possible for some data types, such as Numeric, where multiple text values, such as "001" and "1", are treated as the same value.
-
As long as at least one maskable character is present in the input, the masked value will never match the input.
-
Each masked position influences the mapping done at every other masked position.
For these reasons, this algorithm is useful for masking columns with uniqueness requirements, such as primary and foreign key columns.
This algorithm uses the algorithm extensibility framework, allowing it to be called from other algorithms using that framework.
To decide whether Character Mapping or Segment Mapping is the correct option for your use case, see Choosing Between Character and Segment Mapping frameworks.
Configuration parameters
| Parameter | Description |
|---|---|
| Character groups | Defines groups of characters that can be mapped to one another. Each group may defined either by specifying each literal character in the group, such as "0123456789", or using Java Regular Expression style character ranges, such as "[0-9]". The algorithm will freely map characters to other characters within the same group, so by defining groups "[0-9]" and "[A-Z]", numbers would be replaced by other numbers, and letters by other letters, but a number would never be replaced by a letter. Groups should not contain duplicate characters, and each character may belong to only one group. Any character that is not assigned to a group will be preserved (not masked) by the algorithm. The box below the entry area allows selection of character groups defined for other, preexisting Character Mapping algorithms. |
| Case sensitive | Determines whether uppercase and lowercase characters are treated as distinct characters during mapping. |
| Minimum masked positions | Specifies the minimum number of characters that must be masked. If fewer characters are masked, the value is treated as non-conformant. Null, empty, or whitespace-only values do not trigger non-conformant handling. |
| Preserve leading zeros | Preserves any sequence of 0 characters at the beginning of the input value. This option is useful when numeric identifiers must maintain leading zeros. |
| Preserve ranges | Defines ranges of characters that should remain unchanged during masking. Each range specifies a starting position, length, and direction (forward or reverse). For Character Mapping algorithms, only characters that would otherwise be masked count when determining position for preserve ranges. |
Example
Example configuration:
Character group [0-9]
Example masked values:
(603) 867-5309 → (463) 638-0193
999-12-3456 → 453-71-6283
Call Tom at 8:00PM → Call Tom at 2:75PM
In these examples, only numeric characters are mapped because they belong to the configured character group. Letters and punctuation remain unchanged.
Create an algorithm using this framework
To create an algorithm using this framework, follow the steps in Create an algorithm and select Character Mapping during the Configuration step.