# Data Masking effects

Depending on the semantic type of the column on which you use the Mask data (obfuscation) function, the available parameters and their effects will vary.

## Text and semantic types

For textual data, Talend Data Preparation automatically suggests either one of the predefined semantic types, one of your custom semantic types, or the Text type. In the case of the predefined and custom semantic types, they can be based either on a regular expression, or a dictionary of values.

The following table lists the available masking routines for a column with the Text type, or any of the predefined or custom semantic types, and their effects on the value Talend in 2018 is awesome for example.

| Masking routine | Description | Parameters | Output |
| --- | --- | --- | --- |
| Semantic masking | <ul> <li>For regular expression-based semantic types, the function will                              generate random records that correspond to the regular expression                                 pattern.<div><span>Information note</span><span>Note:</span> Semantic types built with regular expressions that                                 are not compatible with the <a href="http://www.brics.dk/automaton/faq.html" target="_blank"> <span>dk.brics.automaton</span> </a> library do not support semantic masking, and every                                 character of the record is randomly replaced.</div> </li> <li>For dictionary-based semantic types, the function will randomly                              replace the records with values extracted from the dictionary used to                              create the semantic type in the first place.</li> </ul> | Masking mode: Random or<br>Repeatable | Äåòçôî ëð 1889 òn äipïåvu |
| Keep characters between two positions | All the characters included in the selected interval remain as is, while<br>the ones outside the interval are deleted. | <ul> <li>Beginning index: <kbd>11</kbd></li> <li>End index: <kbd>25</kbd></li> </ul> | 2018 is awesome |
| Generate from Char Pattern | A records with random characters will be created from the pattern of<br>your choice. | <ul> <li>Character pattern: <kbd>aaaaaa 9999 aaaaaaa</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd> </li> </ul> | õaßayè 8908 æluäco |
| Remove characters between two positions | All the characters included in the selected interval are removed, while<br>the ones outside the interval remain as is. | <ul> <li>Beginning index: <kbd>7</kbd></li> <li>End index: <kbd>14</kbd></li> </ul> | Talend is awesome |
| Replace all | All the characters are replaced with the substitute of your<br>choice. | <ul> <li>Replacement: <kbd>x</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | xxxxxxxxxxxxxxxxxxxxxxxxx |
| Replace all digits | All the digits are replaced with the substitute of your choice. Letters<br>are kept as is. | <ul> <li>Replacement: <kbd>9</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | Talend in 9999 is awesome |
| Replace all letters | All the letters are replaced with the substitute of your choice. Digits<br>are kept as is. | <ul> <li>Replacement: <kbd>y</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | yyyyyy yy 2018 yy yyyyyyy |
| Replace characters between two positions | All the characters included in the selected interval are replaced, while<br>the ones outside the interval remain as is. | <ul> <li>Beginning index: <kbd>1</kbd></li> <li>End index: <kbd>6</kbd></li> <li>Replacement: <kbd>a</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | aaaaaa in 2018 is awesome |
| Replace first n characters | Replaces the first n characters with the substitute of your choice,<br>while the following ones remain as is. | <ul> <li>Number of characters: <kbd>17</kbd></li> <li>Replacement: <kbd>@</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | @@@@@@@@@@@@@@@@@ awesome |
| Replace last n characters | Replaces the last n characters with the substitute of your choice, while<br>the previous ones remain as is. | <ul> <li>Number of characters: <kbd>10</kbd></li> <li>Replacement: <kbd>!</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | Talend in 2018 !!!!!!!!!! |
| Keep first n digits and replace following ones | Keep the first n digits as is and replaces subsequent ones with random<br>digits. Non-digits characters remain as is. | <ul> <li>Number of digits: <kbd>1</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | Talend in 2436 is awesome |
| Keep last n digits and replace previous ones | Keep the last n digits as is and replaces previous ones with random<br>digits. Non-digits characters remain as is. | <ul> <li>Number of digits: <kbd>2</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | Talend in 1618 is awesome |

## Numeric values

The following table lists the available masking routines for a column containing numeric values, with the Integer or Decimal type, and their effect on the value 21803 for example.

| Masking routine | Parameters | Output |
| --- | --- | --- |
| Replace with random value | <ul> <li>Maximum variation (%): <kbd>10</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | 21499 |
| Generate value between two values | <ul> <li>Minimum value: 20000</li> <li>Maximum value: 22000</li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | 21876 |

## Dates

The following table lists the available masking routines for a column with the Date semantic type, and their effects on the value 05/04/2018 for example.

| Masking routine | Parameters | Output |
| --- | --- | --- |
| Replace with random date | <ul> <li>Maximum variation (in days): <kbd>365</kbd></li> <li>Masking mode: <kbd>Random</kbd> or                                 <kbd>Repeatable</kbd></li> </ul> | 23/11/2017 |
| Keep year and set day and month to 01/01 | N/A | 01/01/2018 |